anxkhn/force-motion

Tiny toggle: keep Reduce Motion on in macOS, let websites keep their motion.

★ 0Forks 0JavaScriptGitHub ↗Compare
accessibilitybrowser-extensionchrome-extensioncssfirefox-addonmanifest-v3prefers-reduced-motionwebextension

README

Force Motion

Force Motion play icon

I like motion on websites. Hover states, page transitions, the small interactions people actually design. I do not want that in macOS. The dock, Mission Control, and the rest of the system chrome feel better with Reduce Motion on.

So the OS setting stays on, and this toggle tells the browser that pages should see prefers-reduced-motion: no-preference.

No popup, no settings page. A few kilobytes.

Icon Color What pages see
Play Purple prefers-reduced-motion: no-preference
Pause Gray Whatever the OS reports. Reloads this tab only.

Other tabs stay put until you refresh them.

Install

Chromium

Chrome, Edge, Brave, and Arc on version 121 or newer.

  1. Open chrome://extensions
  2. Turn on Developer mode
  3. Load unpacked and pick this folder

Firefox

Firefox 128 or newer.

  1. Open about:debugging#/runtime/this-firefox
  2. Load Temporary Add-on
  3. Choose manifest.json

Note

A temporary Firefox add-on is gone the next time you quit the browser. Load it again from this folder, or sign it through addons.mozilla.org if you want it to stick.

Tip

After install, open check.html. Both the JS line and the CSS line should say MOTION OK while the toggle is on.

Important

file:// pages only see the script if you allow the extension access to file URLs. Chrome puts that toggle on the extension's details page.

How it works

Chrome runs background.js as a Manifest V3 service worker. Firefox uses the same file as an event page. MDN documents that split: both service_worker and scripts live in the manifest, and each browser picks the one it supports.

What the injected script changes

With the toggle on, inject.js starts in the page's main world before the site's own scripts:

  • matchMedia('(prefers-reduced-motion: …)') reports no preference
  • @media (prefers-reduced-motion) rules the script can read get rewritten so the reduce branch does not apply

Warning

Stylesheets from another origin that hide cssRules stay untouched. Same-origin CSS and most JS motion libraries are covered.

Nothing is sent anywhere. The only stored value is a boolean in chrome.storage.local. Firefox also declares data_collection_permissions as none.

License

MIT

Contributors

anxkhn

Issues