Go to Twitter\'s login page and type the following in the console:
window.addEventListener(\'keypress\', function(e){console.log(\'hello\')}, true)
This problem doesn't occur on Firefox.
I've checked on Chrome and apparently for some reason the Gmail and Twitter pages end up reassigning console.log to an empty function function () {}
, so your handler gets called but it does nothing. If you try alert()
instead of console.log, you'll see it working.
Interesting.