Skip to content

Instantly share code, notes, and snippets.

@blackle
Last active December 2, 2024 10:13
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
// @onlyonce
// ==/UserScript==
UC.noTabScroll = {
exec: function (win) {
let {customElements, alert} = win;
Object.defineProperties(customElements.get('arrowscrollbox').prototype, {scrollClientSize: {value: 1e1000}});
// const old_on_underflow = customElements.get('arrowscrollbox').prototype.on_underflow;
// customElements.get('arrowscrollbox').prototype.on_underflow = function (e) {
// if (this.id === "tabbrowser-arrowscrollbox") {
// e.preventDefault();
// return;
// }
// old_on_underflow.call(this, e);
// };
// const old_on_overflow = customElements.get('arrowscrollbox').prototype.on_overflow;
// customElements.get('arrowscrollbox').prototype.on_overflow = function (e) {
// if (this.id === "tabbrowser-arrowscrollbox") {
// e.preventDefault();
// return;
// }
// old_on_overflow.call(this, e);
// };
// customElements.get('tabbrowser-tabs').prototype._initializeArrowScrollbox = function () {
// return;
// };
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment