Middle-click autoscroll in Chrome on macOS

Published

On Windows, Chrome has a feature I use constantly: click the mouse wheel on a page, the cursor turns into an arrow, and moving the mouse controls the scroll speed and direction. Firefox has it on every platform. Chrome on macOS does not, there is no setting for it, and the usual answer online is "install an extension". The extensions are JavaScript reimplementations that cannot run on chrome:// pages, the PDF viewer or the Web Store. I wanted the real thing, so I read the Chromium source.

The feature is there, it is just switched off

Autoscroll is implemented in Blink and gated by a runtime feature called MiddleClickAutoscroll. In runtime_enabled_features.json5 it has status: "test", which means off everywhere by default. The comment above it says it is enabled by default on Windows only and that support on other platforms is the "experimental" part.

Windows gets it from one unconditional line inside an IS_WIN block in web_view_impl.cc:

#if BUILDFLAG(IS_WIN)
  RuntimeEnabledFeatures::SetMiddleClickAutoscrollEnabled(true);
#endif

Nothing else enables it on any platform. There is no chrome://flags entry in about_flags.cc, no enterprise policy, and no base::Feature behind it, so field trials cannot flip it either. The "Experimental Web Platform features" flag does not help: it enables features with status experimental, not test.

Everything the feature needs exists on macOS. The panning cursors are mapped to native cursors in ui/base/cocoa/cursor_utils.mm, and the browser-side scroll handling in components/input is platform-independent. Chromium's own browser test for autoscroll turns the feature on with the generic --enable-blink-features switch, and that switch works in a release build of Chrome too.

Enabling it

Quit Chrome completely, then start it with the switch. It has to be present when the browser process starts.

open -na "Google Chrome" --args --enable-blink-features=MiddleClickAutoscroll

Middle-click a page and move the mouse. It behaves exactly like Chrome on Windows: the page moves in the direction you move the cursor, faster the further you go, and a click ends it. I tested this on macOS 26 with Chrome 152. The same switch works on Linux, where it has been passed around forums since 2018.

Chrome shows a dismissible "You are using an unsupported command-line flag" bar once per launch, because the switch is on the list in bad_flags_prompt.cc. Live with it.

Making it permanent

macOS has no configuration file for Chrome launch arguments, so the switch has to come from whatever launches Chrome. The simplest version is a one-line AppleScript applet:

osacompile -o ~/Applications/"Chrome Autoscroll.app" \
  -e 'do shell script "open -a \"Google Chrome\" --args --enable-blink-features=MiddleClickAutoscroll"'

Put that app in the Dock and in Login Items instead of Chrome itself. Links opened from other apps land in the already-running instance, so they keep the flag as long as Chrome was started through the wrapper.

I went one step further and made a proper app bundle with Chrome's icon and a small shell script as its executable. The script matters for one reason: if Chrome is already running without the flag, open -a would silently activate it and autoscroll would not work, with nothing telling you why. So the script checks first and says so.

#!/bin/bash
set -euo pipefail

FLAG='--enable-blink-features=MiddleClickAutoscroll'
CHROME='/Applications/Google Chrome.app'

if [ ! -d "$CHROME" ]; then
  osascript -e 'display alert "Chrome Autoscroll" message "Google Chrome was not found in /Applications." as critical'
  exit 1
fi

# Switches only apply when the browser process starts. If Chrome is already
# running without the flag, say so instead of silently activating it.
while read -r pid cmd; do
  case "$cmd" in
    *--user-data-dir=*) continue ;;   # a separate test profile, not the main browser
    *"$FLAG"*) continue ;;
  esac
  osascript -e 'display alert "Chrome Autoscroll" message "Chrome is already running without the autoscroll flag. Quit Chrome fully (Cmd-Q), then open Chrome Autoscroll again." as warning'
  exit 1
done < <(ps -axww -o pid=,command= | grep -E "^ *[0-9]+ $CHROME/Contents/MacOS/Google Chrome( |\$)" || true)

exec open -a "$CHROME" --args "$FLAG"

The bundle is the script at Contents/MacOS/chrome-autoscroll, an Info.plist naming it as CFBundleExecutable with LSUIElement set to true so the wrapper never shows up as a running app, and Chrome's app.icns copied into Contents/Resources. Sign it ad hoc with codesign --force --deep -s - "Chrome Autoscroll.app" so Login Items and Gatekeeper are happy.

Other browsers

Brave exposes this properly. On macOS and Linux it has a brave://flags/#middle-button-autoscroll entry, added in its own about_flags.cc, which does what Chrome's missing flag would do. Any other Chromium-based browser and any Electron app should accept the launch switch.

The upstream fix would be a one-line change to enable the feature on macOS and Linux, or a chrome://flags entry. Chromium has had an open request for autoscroll on all platforms for years. The code is there, waiting.