From 4d38af402ffcd7940ebc35ea698d124c001390ce Mon Sep 17 00:00:00 2001 From: sethburkart123 Date: Wed, 21 Aug 2024 21:10:52 +1000 Subject: [PATCH] fix: respect prefers reduced motion by default --- src/background.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/background.ts b/src/background.ts index a741f771..d09f81a8 100644 --- a/src/background.ts +++ b/src/background.ts @@ -283,6 +283,11 @@ async function UpdateCurrentValues() { browser.runtime.onInstalled.addListener(function (event) { browser.storage.local.remove(['justupdated']); browser.storage.local.remove(['data']); + + if (event.reason == 'install' && window.matchMedia('(prefers-reduced-motion: reduce)').matches) { + browser.storage.local.set({ animations: false }); + } + UpdateCurrentValues(); if ( event.reason == 'install', event.reason == 'update' ) { browser.storage.local.set({ justupdated: true });