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.

  1. Go to a site where vimium works (i.e. example.com)

  2. Devtools > Sources > Enable Listener Breakpoints > Keyboard (check)

  3. Console & dispatch a sample event:

event = new KeyboardEvent("keydown", { key: "Enter" });

element = document.querySelector("body");

element.dispatchEvent(event);
  1. Get thrown back into Sources, straight into the utils.js file from vimium (full path chrome-extension://dbepggeogbaibhgnhhndojpepiihcmeb/lib/utils.js)

  2. See that the event get ignored instead of getting handled, since event.isTrusted !== true.

  3. Explore further with F10; exit from breakpoint with F8

  4. See true get 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)

Most upvoted comments