I am trying to implement an almost cross-browser bookmark functionality and found this on SO: How do I add an "Add to Favorites" button or link on my website?
It's possible that the WordPress theme you are using has an element with id=sidebar.
Unless a global variable with the same name has been explicitly defined, a global variable will be created for each element that has an id.
So, the first test is unreliable. For example, evaluating window.sidebar
on the stackoverflow page will be true even in Chrome, because the website uses an element with such an id.