Skip to content

Instantly share code, notes, and snippets.

@blackle
Created February 22, 2023 00:21
Show Gist options
  • Save blackle/a06fcbbf82e07b06ea11ea552789d709 to your computer and use it in GitHub Desktop.
Save blackle/a06fcbbf82e07b06ea11ea552789d709 to your computer and use it in GitHub Desktop.
Userscript for disabling tab scroll
// ==UserScript==
// @name noTabScroll
// @author blackle
// @include main
// @startup UC.noTabScroll.exec(win);
// @shutdown UC.noTabScroll.destroy();
// @onlyonce
// @shutdown
// ==/UserScript==
const {
MozElements,
} = window;
UC.noTabScroll = {
exec: function (win) {
let {customElements} = win;
customElements.get('arrowscrollbox').prototype.on_underflow = function (e) {
e.preventDefault();
};
customElements.get('arrowscrollbox').prototype.on_overflow = function (e) {
e.preventDefault();
};
customElements.get('tabbrowser-tabs').prototype._initializeArrowScrollbox = function () {
return;
};
},
destroy: function () {
delete UC.noTabScroll;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment