{"action":"created","issue":{"url":"https://api.github.com/repos/philc/vimium/issues/1718","labels_url":"https://api.github.com/repos/philc/vimium/issues/1718/labels{/name}","comments_url":"https://api.github.com/repos/philc/vimium/issues/1718/comments","events_url":"https://api.github.com/repos/philc/vimium/issues/1718/events","html_url":"https://github.com/philc/vimium/issues/1718","id":85801436,"number":1718,"title":"[Update: confusing] keypress is not triggered for a PDF page","user":{"login":"gdh1995","id":5547703,"avatar_url":"https://avatars.githubusercontent.com/u/5547703?v=3","gravatar_id":"","url":"https://api.github.com/users/gdh1995","html_url":"https://github.com/gdh1995","followers_url":"https://api.github.com/users/gdh1995/followers","following_url":"https://api.github.com/users/gdh1995/following{/other_user}","gists_url":"https://api.github.com/users/gdh1995/gists{/gist_id}","starred_url":"https://api.github.com/users/gdh1995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdh1995/subscriptions","organizations_url":"https://api.github.com/users/gdh1995/orgs","repos_url":"https://api.github.com/users/gdh1995/repos","events_url":"https://api.github.com/users/gdh1995/events{/privacy}","received_events_url":"https://api.github.com/users/gdh1995/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-06T18:58:27Z","updated_at":"2015-06-17T15:03:38Z","closed_at":"2015-06-17T11:03:39Z","body":"Update: I once thought it's my mistake. But just before I tried again, and found something strange:\r\n`keypress` event is bubbled only when the PDF `<embed>` is active, which means Vimium is in an insert mode, and if only I press `esc` to make `<body>` gets the focus, only `keydown` triggered, then making Vimium not recognize common a-z keys.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5547703/8207362/a0e22c08-1533-11e5-8ef6-a6734ee06f59.png)\r\n\r\n\r\nOld\r\n==============\r\nWell, I met a problem when reading a PDF page: `keypress` is never triggered.\r\n* Vimium doesn't receive any `keypress` event, even when I have removed `keydown` and `keyup` listeners from the extension source code and remove the `<embed>` PDF object.\r\n* No other extension; the Developer Tools does not show any other listeners.\r\n* In `[\"keydown\", \"keypress\", \"keyup\"]`, `keydown` and `keyup` will be dispatched to `window` and then trigger Vimium's listeners (vimium_frontend.coffee:196), which does work.\r\n\r\nI've searched other issues, but those reports only said about the `insert` mode. In my case, insert mode is on when page finishs loading, and `<esc>` makes it exit successfully (because `keydown` event still works).\r\n\r\nThis problem makes most key maps invalid, except those with \"<[acm]-\".\r\n\r\nMore Information:\r\n*Chrome Version: 42.0.2311.135 (stable)\r\n* PDF plugin: its name is \"Chrome PDF Viewer\"; no version info shows in chrome://plugins\r\n* my most other plugins have been disabled\r\n* In the Developer Tools, I find `document does not have `head`, but there's indeed a `body` with nodeName `BODY`, and PDF `<embed>` is `document.body`'s first child.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/philc/vimium/issues/comments/112835509","html_url":"https://github.com/philc/vimium/issues/1718#issuecomment-112835509","issue_url":"https://api.github.com/repos/philc/vimium/issues/1718","id":112835509,"user":{"login":"gdh1995","id":5547703,"avatar_url":"https://avatars.githubusercontent.com/u/5547703?v=3","gravatar_id":"","url":"https://api.github.com/users/gdh1995","html_url":"https://github.com/gdh1995","followers_url":"https://api.github.com/users/gdh1995/followers","following_url":"https://api.github.com/users/gdh1995/following{/other_user}","gists_url":"https://api.github.com/users/gdh1995/gists{/gist_id}","starred_url":"https://api.github.com/users/gdh1995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdh1995/subscriptions","organizations_url":"https://api.github.com/users/gdh1995/orgs","repos_url":"https://api.github.com/users/gdh1995/repos","events_url":"https://api.github.com/users/gdh1995/events{/privacy}","received_events_url":"https://api.github.com/users/gdh1995/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T15:03:38Z","updated_at":"2015-06-17T15:03:38Z","body":"Confirmed: it's a Chrome bug imported since 42. I've tried 37 and 41.0.2272.89, and both are OK.\r\n\r\nThe two viewer plugin above can be turned off.\r\n* If I disable the first (mime is app/pdf), pdf files can not be shown.\r\n  The whole page is just grey but Vimium will work well.\r\n* If I disable the second, Chrome shows \"Chrome PDF Viewer has been disabled. balabala\".\r\n* If turn off \"#enable-out-of-process-pdf\" in chrome://flags, PDF pages become grey...\r\n\r\nSo, it's `chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/` who prevents keypress events.\r\n\r\nI will try 43 in a while.\r\nWarning: My Chrome has been broken by an old version of 37... So attention is a must when some one switchs Chrome - `sandboxie` is recommended"}}