Skip to content

Instantly share code, notes, and snippets.

@ChristianKurz
Last active March 1, 2019 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChristianKurz/839241c63dc70a454cae68ce000fb985 to your computer and use it in GitHub Desktop.
Save ChristianKurz/839241c63dc70a454cae68ce000fb985 to your computer and use it in GitHub Desktop.
Firefox 57+: scroll through tabs with mouse wheel, adapted from here: https://forum.manjaro.org/t/howto-enable-tab-switching-in-firefox-using-mouse-wheel/39954
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bindings>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="tabs-scroll" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox">
<handlers>
<handler event="wheel"><![CDATA[
// Preserve original behaviour if meta (Windows) key is held
if (event.metaKey) return;
currentindex = gBrowser.tabContainer.selectedIndex;
if (event.deltaY < 0 && currentindex != 0) {
gBrowser.tabContainer.advanceSelectedTab(-1, true);
}
if (event.deltaY > 0 && currentindex + 1 != gBrowser.tabs.length) {
gBrowser.tabContainer.advanceSelectedTab(1, true);
}
event.stopPropagation();
event.preventDefault();
]]></handler>
</handlers>
</binding>
</bindings>
.tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox {
/* Place bindings.xml in the same folder as userChrome.css */
-moz-binding: url("bindings.xml#tabs-scroll") !important;
}
@ChristianKurz
Copy link
Author

Now without wrap around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment