diff --git a/content/style-injector.js b/content/style-injector.js index ceeb1c60..d870ae63 100644 --- a/content/style-injector.js +++ b/content/style-injector.js @@ -15,7 +15,7 @@ window.StyleInjector = window.INJECTED === 1 ? window.StyleInjector : ({ const list = []; const table = new Map(); let isEnabled = true; - let isTransitionPatched; + let isTransitionPatched = chrome.app && CSS.supports('accent-color', 'red'); // Chrome 93 let exposeStyleName; // will store the original method refs because the page can override them let creationDoc, createElement, createElementNS; diff --git a/global.css b/global.css index 785afdcd..6f782515 100644 --- a/global.css +++ b/global.css @@ -1,8 +1,11 @@ -html#stylus #header *:not(#\1transition-suppressor) { +@supports not (accent-color: red) { /* This suppresses a bug in all? browsers: they apply transitions during page load. + * It was fixed by crrev.com/886802 in Chrome 93, which we detect via `accent-color`. * Using an increased specificity to override sane selectors in user styles. * Using \1 to simplify js code because \0 is converted to \xFFFD per spec. */ - transition: none !important; + html#stylus #header *:not(#\1transition-suppressor) { + transition: none !important; + } } :root { --family: Arial, "Helvetica Neue", Helvetica, system-ui, sans-serif; diff --git a/js/dom-on-load.js b/js/dom-on-load.js index 213fcb02..8358ca38 100644 --- a/js/dom-on-load.js +++ b/js/dom-on-load.js @@ -1,5 +1,5 @@ /* global $$ $ $create focusAccessibility getEventKeyName moveFocus */// dom.js -/* global clamp debounce */// toolbox.js +/* global CHROME clamp debounce */// toolbox.js /* global msg */ /* global t */// localization.js 'use strict'; @@ -24,11 +24,13 @@ } }); // Removing transition-suppressor rule - const {sheet} = $('link[href$="global.css"]'); - for (let i = 0, rule; (rule = sheet.cssRules[i]); i++) { - if (/#\\1\s?transition-suppressor/.test(rule.selectorText)) { - sheet.deleteRule(i); - break; + if (!CHROME || CHROME < 93) { + const {sheet} = $('link[href$="global.css"]'); + for (let i = 0, rule; (rule = sheet.cssRules[i]); i++) { + if (/#\\1\s?transition-suppressor/.test(rule.cssText)) { + sheet.deleteRule(i); + break; + } } }