philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.02k stars 2.47k forks source link

Custom root for sites that break scrolling? notion.site, etc #4517

Open mcint opened 2 months ago

mcint commented 2 months ago

Rationale I'm posting this because I had some success in 15 minutes of learning how to fix scrolling for notion sites. Practically speaking, it's currently not even a workaround. I want to raise my finding to the attention of someone who could quickly, easily confirm this diagnosis and proposed solution.

Describe the bug Notion and some other sites that break vimium interaction seem to perform scrolling in a custom viewport of the main document. I would like to manually set the activated element interactively, and eventually, specify a custom default scrolling element for *.notion.site sites, the user sites that break browser (Space/Shift-Space) and vimium (j/k+d/u,...) scrolling by default.

To Reproduce Currently, when I click on the page, the browser, per notion's defaults, sets document.activeElement = <body class="notion-body vsc-initialized">...

If I instead set the active element to the root tag of their client reader hierarchy, browser scrolling works as expected, though vimium scrolling stays broken. console: document.activeElement = $('main'), then return focus to the page without clicking, C-l selects URL bar,

Browser and Vimium version

UncleSnail commented 2 months ago

Allowing a custom root per site seems like a reasonable idea.

I'm not sure, but this might be a bug in nextFrame, since I think that might be what that function is meant to be for?