I have two bookmarklets that work individually 1)
javascript:(function(){window.open("http://mail.yahoo.com");})();
2)
javascript:(function(){;document.getElementsByClassName('btn-compose')[0].click()})();
(the above lines of code were put through a bookmarklet generator here: http://ted.mielczarek.org/code/mozilla/bookmarklet.html and each bookmarklet works fine)
but when they are together like so: javascript:(function(){window.open("http://mail.yahoo.com");document.getElementsByClassName('btn-compose')[0].click()})();
or like so:
javascript:(function(){window.open("http://mail.yahoo.com");})();
javascript:(function(){;document.getElementsByClassName('btn-compose')[0].click()})();
the compose window does not open. I have a feeling the DOM is not ready.
but this fails:
javascript:(function(){window.open("http://mail.yahoo.com");})();
document.onreadystatechange = function () {
if (document.readyState == "complete") {
javascript:(function(){;document.getElementsByClassName('btn-compose')[0].click()})();
}
}