August 2008 Archives
Key events, window.open, and popup blockers
Posted on August 1st, 2008 by TedRecently, I was attempting to open a window/tab using JavaScript from a key handler and the popup blocker in Firefox prevented it from opening. This was slightly surprising since the same code was working from within an onclick handler and the domain of the window to be opened was identical.
Here’s an example window.open:
window.open('http://bustoutsolutions.com/', '_blank');
It turns out that doing this from within an onkeyup handler will cause the popup blocker to fire, but from within an onkeypress handler, it opens with no warnings.



