From 3985ade64337ee2901f4f608ebe6cdc3d5f0c0bb Mon Sep 17 00:00:00 2001 From: starknt <1431880400@qq.com> Date: Fri, 12 Jan 2024 23:57:27 +0800 Subject: [PATCH] fix: `global Speed` conflict --- src/contentScripts/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/contentScripts/index.ts b/src/contentScripts/index.ts index 0c2f9440..ca65c46f 100644 --- a/src/contentScripts/index.ts +++ b/src/contentScripts/index.ts @@ -138,7 +138,9 @@ function injectApp() { container.id = 'bewly' const root = document.createElement('div') const styleEl = document.createElement('link') - const shadowDOM = container.attachShadow?.({ mode: __DEV__ ? 'open' : 'closed' }) || container + // Fix #69 https://github.com/hakadao/BewlyBewly/issues/69 + // https://medium.com/@emilio_martinez/shadow-dom-open-vs-closed-1a8cf286088a - open shadow dom + const shadowDOM = container.attachShadow?.({ mode: 'open' }) || container styleEl.setAttribute('rel', 'stylesheet') styleEl.setAttribute('href', browser.runtime.getURL('dist/contentScripts/style.css')) shadowDOM.appendChild(styleEl)