How can I get google chrome to switch tabs using the mouse wheel?

27

7

At home I'm running Fedora 17, and I've grown accustomed to quickly scanning through open tabs by using the mouse wheel while hovering over the tab bar. It's a very natural gesture for me now.

At least once a week at work (usually Mondays), I attempt to use the same technique on chrome running on a MacBook Pro, but the tabs won't budge. This is starting to make me crazy.

Does anyone have a solution which will allow me to use the scroll wheel to change tabs on google chrome for OSX?

(I found the following google code thread, but the suggested fix does not address the issue as far as I can tell -- http://code.google.com/p/chrome-convenience-extension/issues/detail?id=31)

user636685

Posted 2012-11-12T17:38:25.320

Reputation: 291

1In Chrome on Ubuntu, this behavior is enabled by default; if the mouse is on the tab bar when I scroll, it switches tabs. I'd very much like a way to turn this behavior off. – Keith Thompson – 2017-02-27T18:02:57.167

@KeithThompson what would you prefer to happen when you scroll while hovering the tab bar? – Mihail Malostanidis – 2020-01-29T09:31:41.710

@MihailMalostanidis: I'd prefer for nothing to happen.And that appears to be the current behavior (I'm using Chrome on Windows 10 at the moment). – Keith Thompson – 2020-01-29T20:37:10.427

1Did you ever find a solution? – Some Guy – 2014-02-21T15:36:53.330

Answers

8

The extension Chrome Toolbox might be of interest to you:

Chrome Toolbox Options

I have not tested it on OSX but it's working for Windows 7 and there should not be compatibility problems there.

fierflash

Posted 2012-11-12T17:38:25.320

Reputation: 97

2These options seem to be missing from my install of the Chrome Toolbox extension. It seems to be OS-dependent. Still looking for a solution... – user636685 – 2013-01-18T14:42:19.337

Most of the tab options (including the scroll mouse option) aren't available in OS X. – namuol – 2013-09-16T04:09:20.593

7The extension is broken in current chrome versions and has been removed from the extension store. – ThiefMaster – 2013-12-30T12:23:38.420

7

Found a solution on a Google Groups thread. Use AutoHotKey with the following script:

;; Wheel Scroll Tabs for Google Chrome 

#IfWinActive ahk_class Chrome_WidgetWin_1 
 ~$WheelDown:: 
 ~$WheelUp:: 
    MouseGetPos,, yaxis 
    IfGreater,yaxis,23, Return 
    IfEqual,A_ThisHotkey,~$WheelDown, Send ^{PgDn} 
                                 Else Send ^{PgUp} 
Return 
#IfWinActive

Note: I've changed it to Chrome_WidgetWin_1 because that's what worked for me. If that doesn't work for you, try changing it to Chrome_WidgetWin_0

Source

Some Guy

Posted 2012-11-12T17:38:25.320

Reputation: 171

2

If you are using Chrome 32+ check this solution with AutoHotKey (compiled script). Chrome Toolbox is not working on Chrome above 31.

https://plus.google.com/115670442023408995787/posts/WYPqqk2j9UB

Or use directly:

; Mouse Wheel Tab Scroll 4 Chrome
; -------------------------------
; Scroll though Chrome tabs with your mouse wheel when hovering over the tab bar.
; If the Chrome window is inactive when starting to scroll, it will be activated.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn   ; Enable warnings to assist with detecting common errors.
#SingleInstance force   ; Determines whether a script is allowed to run again when it is already running.
#UseHook Off    ; Using the keyboard hook is usually preferred for hotkeys - but here we only need the mouse hook.
#InstallMouseHook
#MaxHotkeysPerInterval 1000 ; Avoids warning messages for high speed wheel users.

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
Menu, Tray, Tip, Mousewheel tab scroll for Chrome (1.0.3)

WheelUp::
WheelDown::
    MouseGetPos,, ypos, id
    WinGetClass, class, ahk_id %id%
    If (ypos < 45 and InStr(class,"Chrome_WidgetWin"))
    {
        IfWinNotActive ahk_id %id%
            WinActivate ahk_id %id%
        If A_ThisHotkey = WheelUp
            Send ^{PgUp}
        Else
            Send ^{PgDn}
    }
    Else
    {
        If A_ThisHotkey = WheelUp
            Send {WheelUp}
        Else
            Send {WheelDown}
    }
    Return

Xsoft

Posted 2012-11-12T17:38:25.320

Reputation: 21

There is one flaw in this answer: it's about a Windows specific implementation and it doesn't explain how the code works so that it could be ported to scripting environments available on other platforms. – LiveWireBT – 2016-03-21T01:21:29.127

1

I have no issues with Chrome/Chromium on Ubuntu, the functionality you describe just works for me. However I currently have¹ to use Chrome on Windows where I miss this functionality.

As some have mentioned, there exist some implementations in scripting languages² like AutoHotKey, which is only for Windows and I never felt the need to run AutoHotKey, AutoIt or any similar software on Linux/OSX; but as I understand it AutoKey and Automator should be equivalent pieces of software. So it should be possible to re-implement the sending of basic keystrokes in those languages for the specific platform.

Here is the solution that currently works for me: AutoHotKey Community - tab_switcher - switch tabs with mousewheel in any tabbed window

Hello,

here is another script for switching tabs with the mousewheel - this example script is for Chrome, Firefox and Internet Explorer, but also usable for any other program.

TabJumper(psWindowClass, piStripeYStart, piStripeYEnd)
{
    WinGet, idSearchWindow, ID, ahk_class %psWindowClass%
    MouseGetPos, iMouseX, iMouseY, idHoverWindow
    if (idSearchWindow=idHoverWindow
        && iMouseY>=piStripeYStart
        && iMouseY<=piStripeYEnd ) {

        ControlFocus,, ahk_id %idHoverWindow%
        if RegExMatch(A_ThisHotkey, "i).*wheelup.*")
        {
            ControlSend, ahk_parent, {Control Down}{Shift Down}{Tab Down}, ahk_id %idHoverWindow%
            Sleep, 60
            ControlSend, ahk_parent, {Tab Up}{Shift Up}{Control Up}, ahk_id %idHoverWindow%
        }
        else if RegExMatch(A_ThisHotkey, "i).*wheeldown.*")
        {
            ControlSend, ahk_parent, {Control Down}{Tab Down}, ahk_id %idHoverWindow%
            Sleep, 60
            ControlSend, ahk_parent, {Tab Up}{Control Up}, ahk_id %idHoverWindow%
        }
    }
}

Usage example for chrome:

#SingleInstance, force

~WheelUp::
    TabJumper("Chrome_WidgetWin_1", 8, 88)
return

~WheelDown::
    TabJumper("Chrome_WidgetWin_1", 8, 88)
return

Parameters explained:

  • TabJumper([Window class], [horizontal reaction stripe y axis start], [[horizontal reaction y axis end]])

    Whats about this "horizontal reaction stripe"?

    This means only in this stripe of a window tabs are switched, the other part of the window reacts normally with mouse wheel like e.g. scrolling up and down a web page.

Usage: Yes, just installing AutoHotKey, creating a new .ahk file, pasting both code blocks and executing the script brings you the functionality. (Additional markup added by me.)

To help with the understanding: {Control Down}{Shift Down}{Tab Down} and {Tab Up}{Shift Up}{Control Up} are the keystrokes, one is the sequence for pressing and holding Crtl+Shift+Tab, the other for releasing them. Here is the list with keyboard shortcuts from Chrome.


  1. I personally prefer Firefox over Chromium/Chrome on all my devices, but at work a certain software manufacturer is unable to publish the vital browser extension as a signed Firefox extension (and MS Edge) for the particular product. Regarding Google desktop software, at the time of writing most of it is inferior outside the twenty-somthing techbro doing terminal stuff in a web browser with a Chromebook usecase from my point of view.
  2. Running a separate script for this (basic) functionality is wrong and overkill. I completely agree with everyone on that opinion.

LiveWireBT

Posted 2012-11-12T17:38:25.320

Reputation: 737

0

  1. Download and install X-Mouse Button Control.
  2. Open "Setup" from tray menu.
  3. Add a new profile for Chrome. Refer to the image below. Strings to copy: chrome.exe, Intermediate D3D Window, Chrome_WidgetWin_1, Google Chrome Tab Scroll.enter image description here
  4. Choose Simulated Keys for Wheel Up: enter image description here
  5. Enter {CTRL}{PGUP}, Check the "Only send if profile's process is active" option, and press OK. enter image description here
  6. Repeat 4 for Wheel Down.
  7. Repeat 5 with {CTRL}{PGDN}.
  8. Click on Apply.

Aaaand you're done

Paul

Posted 2012-11-12T17:38:25.320

Reputation: 1 022

0

There is a simple chrome extension which allow you to scroll tabs with alt + mouse wheel up / down:

https://chrome.google.com/webstore/detail/tab-wheel-scroll/aknfcgiicpmnfhncpljcadokcghjblal?hl=fr

John

Posted 2012-11-12T17:38:25.320

Reputation: 9

2If you are the author of this extension, please disclose your affiliation with it. – slhck – 2014-08-23T07:51:02.347

And if not, please disclaim affiliation. – Daniel H – 2017-09-11T15:12:50.647