-
-
Save fm3/fcb0d002a3a3d88a771ddb80ffbc01e7 to your computer and use it in GitHub Desktop.
Change tabs with mousewheel in Firefox 58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* To enable changing tabs by using the mouse wheel, | |
* enter this code into the browser console (Ctrl+Shift+J) */ | |
var onTabWheel = function(ev) { | |
if (ev.deltaMode == 1 /* DOM_DELTA_LINE */) { | |
var idx = gBrowser.tabContainer.getIndexOfItem(gBrowser.selectedTab); | |
var direction = ev.deltaY > 0 ? 1 : -1; | |
gBrowser.selectTabAtIndex((idx + direction) % gBrowser.tabs.length); | |
} | |
} | |
gBrowser.tabContainer.arrowScrollbox.addEventListener("wheel", onTabWheel); |
Thanks, what a lifesaver! Could this be wrapped as a simple Firefox extension, by chance?
@muesli someone in the manjaro forums figured out a way to enable this on startup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated for Firefox 58, using renamed field
arrowScrollbox