Don't fuck with my scroll!!!

Whenever the user scrolls using the mouse wheel it will disable all methods to programmatically scroll for 500 ms (0.5 seconds). Basically preventing websites to implement custom scrolling behaviors like smooth scrolling.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
Jinpha
今日安裝
0
安裝總數
278
評價
4 1 0
版本
1.1
建立日期
2019-04-11
更新日期
2019-05-16
尺寸
4.6 KB
授權條款
未知
腳本執行於
所有網站

Why did I create this?

I've noticed that some websites have tried to implement their own smooth scrolling. However, they rarely work as intended and mostly just annoys the user as the scrolling experience is being changed.

This script has been made to block these annoyances and let the browser itself choose how to scroll.

How does it actually work?

This script is very simple. In the initialization of the script it registers all methods that can programmatically scroll the page. These includes: window.scrollTo, window.scrollBy, document.scrollingElement.scrollTop.

Whenever the scripts register that you've scrolled using your mouse wheel it will override these methods described above with a void function that does absolutely nothing. So if a page tried to scroll using these methods while they've been voided it would do nothing which is exactly what we need to prevent these custom behaviors.

After 1 second the voided methods will be restored to their original functionality. This means that if the page tried to scroll using those methods they would work again as expected. We're only interested in blocking the scrolling in the time frame of using the mouse wheel to prevent breaking important features.