vimium: [Bug] vimium's `window.forTrusted()` blocks javascript-dispatched events **not only from itself, but from the whole page**
To Reproduce
Example in chrome; also reproduces the same way in firefox.
-
Go to a site where vimium works (i.e. example.com)
-
Devtools > Sources > Enable Listener Breakpoints > Keyboard (check)
-
Console & dispatch a sample event:
event = new KeyboardEvent("keydown", { key: "Enter" });
element = document.querySelector("body");
element.dispatchEvent(event);
-
Get thrown back into Sources, straight into the
utils.jsfile from vimium (full pathchrome-extension://dbepggeogbaibhgnhhndojpepiihcmeb/lib/utils.js) -
See that the event get ignored instead of getting handled, since
event.isTrusted !== true. -
Explore further with F10; exit from breakpoint with F8
-
See
trueget returned from the same place.
That’s essentially it. I myself encountered this at gitlab, and, well, I ain’t getting those 7 hours of debugging back, so I hope we can fix this so that others don’t need to:D
Browser and Vimium version
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
Google Chrome 84.0.4147.135
$ /Applications/Firefox\ Developer\ Edition.app/Contents/MacOS/firefox --version
Mozilla Firefox 81.0b2
vimium version 1.66 in both
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 17 (6 by maintainers)
Done: https://github.com/philc/vimium/issues/3710 Thanks.