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?
You should use wp_enqueue_script
(Documentation)
Your dependencies may not being called before that script. If you enqueue the script you can make the dependencies load first using
wp_enqueue_script( $handle, $path to file, array( jquery ));`
Since I placed jQuery in the array it will now load jQuery before the script.
addPanel was removed from Firefox since v. 23. But you can use markup instead:
<a href="http://stackoverflow.com" title="Stack Overflow" rel="sidebar">Bookmark me</a>
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.