From 9a50338b91a7661709f013772ca60e9aca378db1 Mon Sep 17 00:00:00 2001 From: kuuuube Date: Sun, 5 Jan 2025 15:52:54 -0500 Subject: [PATCH] Fix tests --- ext/js/core/utilities.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/js/core/utilities.js b/ext/js/core/utilities.js index ad14802a5..62f48793d 100644 --- a/ext/js/core/utilities.js +++ b/ext/js/core/utilities.js @@ -293,6 +293,10 @@ export function addScopeToCss(css, scopeSelector) { */ export function addScopeToCssLegacy(css, scopeSelector) { const stylesheet = new CSSStyleSheet(); + // nodejs must fall back to the normal version of the function + if (typeof stylesheet.replaceSync === 'undefined') { + return addScopeToCss(css, scopeSelector); + } stylesheet.replaceSync(css); const newCSSRules = []; for (const cssRule of stylesheet.cssRules) {