42

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)

9 Answers9

12

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
  • 221
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.

3

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
  • 31
2

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, &quot;i).*wheelup.*&quot;)
    {
        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, &quot;i).*wheeldown.*&quot;)
    {
        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.
2

There's a Chrome extension for Windows users called AutoControl that adds this feature to the browser.
Instructions here:
https://www.autocontrol.app/hover-sensitive-shortcuts#scrollwheel-on-tabs

You can make the scroll wheel to switch tabs either when the mouse is over the tab strip or when it's over the entire title area or when it's anywhere over the browser window or whatever you want.
You can also combine the scroll wheel with CTRL, SHIFT, ALT or other mouse buttons or virtually any combination you can think of. It has more configurability than any other app I've seen.

Mercalli
  • 209
1
  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
  • 2,028
1

It can be done with Windhawk mod:

Paul
  • 2,028
0

Chrome has a configuration flag for this:

  • Open Google Chrome.
  • Copy and paste the following string in the address bar: chrome://flags/#scrollable-tabstrip
  • Enable Scrollable TabStrip flag.
  • Relaunch the browser.
hserge
  • 101
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
  • 9