AutoScroll icon indicating copy to clipboard operation
AutoScroll copied to clipboard

AutoScroll doesn't work well on sites with scroll-behavior: smooth

Open charukiewicz opened this issue 4 years ago • 4 comments

Issue

I noticed that on some sites, using AutoScroll doesn't really work so well. It appears that the problem is the scroll-behavior CSS attribute. The default browser setting is:

html {
  scroll-behavior: auto; /* browser default */
}

Some sites override it to:

html {
  scroll-behavior: smooth;
}

Which leads to issues when using AutoScroll. Here's a side by side comparison on my personal site.

scroll-behavior: auto (click to show):
Regular scroll behavior. Responsive. Stops scrolling immediately upon clicking out of auto-scroll.

scroll-behavior: smooth (click to show):
Broken scroll behavior. Window scrolls very slowly, doesn't reverse direction correctly. Clicking out of auto-scroll causes browser to rapidly scroll in the direction that scroll was attempted.

Possible Fix

It seems like one potential fix would be to explicitly set scroll-behavior: auto on the html element of the document when auto-scroll is enabled. This would override the site's scroll-behavior setting.

charukiewicz avatar May 09 '20 18:05 charukiewicz

I was able to get around this issue with the help of this comment : https://superuser.com/a/1366186/1022880 Bacically it just remove the ability for websites to change the scroll-behaviour of any dom element. It would be nice to be able to solve this issue without having to install another extension.

dc-p8 avatar Dec 16 '20 11:12 dc-p8

For a solution using the forcible overwrite, see commit https://github.com/Pauan/AutoScroll/commit/2ee51a2320c102935698583b48a9a51800283a69 of the fork from ubermanu. You could manually change your AutoScroll.js file in your extension folder accordingly. (Just search for the file AutoScroll.js on your system.) Beware of the corruption detection of Chrome though: https://stackoverflow.com/questions/27080848/edited-chrome-extension-chrome-thinks-it-is-malware A pity, that this extension isn't maintained anymore.

StephanBe avatar Feb 22 '21 17:02 StephanBe

does anyone know of a better alternative to this nowadays that's still actively maintained?

J-HS-L avatar Aug 09 '23 08:08 J-HS-L

does anyone know of a better alternative to this nowadays that's still actively maintained?

I'm using this fork as an alternative.

GalaxySnail avatar Aug 10 '23 06:08 GalaxySnail