vimium icon indicating copy to clipboard operation
vimium copied to clipboard

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

Open clonex10100 opened this issue 4 years ago • 4 comments

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

clonex10100 avatar Aug 17 '20 03:08 clonex10100

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.

gdh1995 avatar Aug 20 '20 08:08 gdh1995

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'
        });

kamkudla avatar Oct 27 '20 06:10 kamkudla

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.

gdh1995 avatar Oct 27 '20 13:10 gdh1995

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

kamkudla avatar Oct 27 '20 16:10 kamkudla