philc / vimium

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

In Firefox, smooth scrolling is very choppy when "privacy.resistFingerprinting" is set to true in about:config #3641

Open clonex10100 opened 4 years ago

clonex10100 commented 4 years ago

I'm not sure if this is Firefox's fault or the extensions fault, but I thought I'd post it here just incase someone else has choppy scrolling and can't figure out why.

To Reproduce Ensure smooth scrolling is on in Vimium-FF and firefox preferences Go to about:config and set "privacy.resistFingerprinting" to true Scroll using vimium keybinds

Browser and Vimium version Firefox Version: 79.0 Os: Arch Vimium-FF Version: 1.66

gdh1995 commented 4 years ago

This is because when this configuration is true, Firefox gives Vimium fake timestamps (something like 0, 0, 0.1sec, 0.1sec, 0.1sec, 0.2sec, 0.2sec, 0.3sec, ...), and Vimium fails in computing scrolling distance if a second timestamp is equal with the one before.

When this is false, then the timestamp will be like 0, 0.017sec, 0.034sec, 0.051sec, ... - the precision is much higher.

kamkudla commented 4 years ago

Are there any solutions to this? I can confirm that window.scrollBy works around the issue with timing:

window.scrollBy({
          top: 100,
          left: 0,
          behavior: 'smooth'
        });
gdh1995 commented 4 years ago

Vimium can work with behavior: 'smooth' - only when the "Use smooth scrolling" is disabled and you don't hold on the key of scroll commands.

kamkudla commented 4 years ago

How do I implement this? I toggled off "Use smooth scrolling" and I am running v1.66.

Update: I changed this line and re-built. Holding the scroll keys works fine.

https://github.com/philc/vimium/blob/bdf654aebe6f570f427c5f7bc9592cad86e642b5/content_scripts/scroller.js#L64