Skip to content

Instantly share code, notes, and snippets.

@fm3
fm3 / ff57-tabs-mousewheel.js
Last active June 13, 2018 07:13 — forked from benoitryder/ff57-tabs-mousewheel.js
Change tabs with mousewheel in Firefox 58
/* 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);
}
}
@fm3
fm3 / firefox-tab-wheel-scroll.ahk
Last active December 2, 2017 23:28
Firefox: Tab Wheel Scroll using AutoHotkey for Windows
#MaxHotkeysPerInterval 200
shouldFire()
{
CoordMode, Mouse, Screen
MouseGetPos, mouseX, mouseY, MouseHoverWin
WinGetPos, winX, winY, width, height, ahk_id %MouseHoverWin%
WinGetClass, class, ahk_id %MouseHoverWin%
if (mouseY - winY >= 0 && mouseY - winY < 40 && class == "MozillaWindowClass") {
return 1
}