Custom root for sites that break scrolling? notion.site, etc
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 27k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
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,
- In DevTools, with not-
Console, sayElements, tab open. - Type
Esc, toggling closedConsole. - Type
Ctrl-L, focusing the URL bar. - Type
Esctwice, first deselecting the URL bar, and after the second, input is handled by the page.- Try browser keyboard scrolling,
Space/Shift-Space, expected to work - Try vimium keyboard scrolling,
j/kord/u, still broken
- Try browser keyboard scrolling,
Browser and Vimium version
- Brave:
1.67.123 Chromium: 126.0.6478.126 (Official Build) (64-bit)/ Linux - Vimium:
2.1.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with content_scripts/scroller.js, especially the scrolling element referenced in the issue, and reproduce the behavior on a notion.site page using the described browser and Vimium key sequences. Determine how a manually activated element or a site-specific default scrolling element would fit the requested behavior; done should include working Vimium scrolling for the affected sites.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100