From b2b7b5929ca7fd377570f6dd3cf7d9bfd6a9421d Mon Sep 17 00:00:00 2001 From: highlander Date: Fri, 3 Apr 2026 15:41:51 -0600 Subject: [PATCH 1/2] fix: remove content-ui HTML bar injected on every page The content-ui script was injecting an empty blue div (bg-blue-100) into every web page via shadow DOM. Removed the DOM injection, gutted the App component to return null, and removed content-ui and content.css entries from manifest content_scripts. Co-Authored-By: Claude Opus 4.6 (1M context) --- chrome-extension/manifest.js | 8 -------- pages/content-ui/src/App.tsx | 13 +------------ pages/content-ui/src/index.tsx | 34 +--------------------------------- 3 files changed, 2 insertions(+), 53 deletions(-) diff --git a/chrome-extension/manifest.js b/chrome-extension/manifest.js index 99ed5bb..50a0c2f 100755 --- a/chrome-extension/manifest.js +++ b/chrome-extension/manifest.js @@ -42,14 +42,6 @@ const manifest = deepmerge( js: ['content/index.iife.js'], run_at: 'document_start', }, - { - matches: ['http://*/*', 'https://*/*', ''], - js: ['content-ui/index.iife.js'], - }, - { - matches: ['http://*/*', 'https://*/*', ''], - css: ['content.css'], - }, ], devtools_page: 'devtools/index.html', web_accessible_resources: [ diff --git a/pages/content-ui/src/App.tsx b/pages/content-ui/src/App.tsx index 285dc73..1b523d7 100644 --- a/pages/content-ui/src/App.tsx +++ b/pages/content-ui/src/App.tsx @@ -1,14 +1,3 @@ -import { useEffect } from 'react'; -// import { Button } from '@extension/ui'; -// import { useStorage } from '@extension/shared'; -// import { exampleThemeStorage } from '@extension/storage'; - export default function App() { - // const theme = useStorage(exampleThemeStorage); - - useEffect(() => { - console.log('content ui loaded'); - }, []); - - return
; + return null; } diff --git a/pages/content-ui/src/index.tsx b/pages/content-ui/src/index.tsx index ad1aada..4c5de5b 100644 --- a/pages/content-ui/src/index.tsx +++ b/pages/content-ui/src/index.tsx @@ -1,33 +1 @@ -import { createRoot } from 'react-dom/client'; -import App from '@src/App'; -import tailwindcssOutput from '../dist/tailwind-output.css?inline'; - -const root = document.createElement('div'); -root.id = 'chrome-extension-boilerplate-react-vite-content-view-root'; - -document.body.append(root); - -const rootIntoShadow = document.createElement('div'); -rootIntoShadow.id = 'shadow-root'; - -const shadowRoot = root.attachShadow({ mode: 'open' }); - -if (navigator.userAgent.includes('Firefox')) { - /** - * In the firefox environment, adoptedStyleSheets cannot be used due to the bug - * @url https://bugzilla.mozilla.org/show_bug.cgi?id=1770592 - * - * Injecting styles into the document, this may cause style conflicts with the host page - */ - const styleElement = document.createElement('style'); - styleElement.innerHTML = tailwindcssOutput; - shadowRoot.appendChild(styleElement); -} else { - /** Inject styles into shadow dom */ - const globalStyleSheet = new CSSStyleSheet(); - globalStyleSheet.replaceSync(tailwindcssOutput); - shadowRoot.adoptedStyleSheets = [globalStyleSheet]; -} - -shadowRoot.appendChild(rootIntoShadow); -createRoot(rootIntoShadow).render(); +// content-ui: no visible UI injected into host pages From 2f2ac1f9ceb0ed86504c6180003fc914b29ede1b Mon Sep 17 00:00:00 2001 From: highlander Date: Sat, 4 Apr 2026 23:25:00 -0600 Subject: [PATCH 2/2] test: remove stale content-ui injection E2E test The content-ui shadow DOM injection was removed, so the test asserting its presence on example.com no longer reflects reality. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/e2e/specs/page-content-ui.test.ts | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 tests/e2e/specs/page-content-ui.test.ts diff --git a/tests/e2e/specs/page-content-ui.test.ts b/tests/e2e/specs/page-content-ui.test.ts deleted file mode 100644 index 50fbb13..0000000 --- a/tests/e2e/specs/page-content-ui.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -describe('Content UI Injection', () => { - it('should locate the injected content UI div', async () => { - await browser.url('https://www.example.com'); - - const contentDiv = await $('#chrome-extension-boilerplate-react-vite-content-view-root').getElement(); - await expect(contentDiv).toBeDisplayed(); - }); -});