Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions chrome-extension/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ const manifest = deepmerge(
js: ['content/index.iife.js'],
run_at: 'document_start',
},
{
matches: ['http://*/*', 'https://*/*', '<all_urls>'],
js: ['content-ui/index.iife.js'],
},
{
matches: ['http://*/*', 'https://*/*', '<all_urls>'],
css: ['content.css'],
},
],
devtools_page: 'devtools/index.html',
web_accessible_resources: [
Expand Down
13 changes: 1 addition & 12 deletions pages/content-ui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -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 <div className="flex items-center justify-between gap-2 bg-blue-100 rounded py-1 px-2"></div>;
return null;
}
34 changes: 1 addition & 33 deletions pages/content-ui/src/index.tsx
Original file line number Diff line number Diff line change
@@ -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(<App />);
// content-ui: no visible UI injected into host pages
8 changes: 0 additions & 8 deletions tests/e2e/specs/page-content-ui.test.ts

This file was deleted.

Loading