Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonghakseo authored Dec 2, 2023
2 parents 12effa6 + ce3ad68 commit fd23d8c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,34 @@
"contributions": [
"doc"
]
},
{
"login": "romaindequidt",
"name": "Romain Dequidt",
"avatar_url": "https://avatars.githubusercontent.com/u/521473?v=4",
"profile": "http://www.iotercom.com",
"contributions": [
"doc"
]
},
{
"login": "jguddas",
"name": "Jakob Guddas",
"avatar_url": "https://avatars.githubusercontent.com/u/25524993?v=4",
"profile": "http://linkedin.com/in/jguddas",
"contributions": [
"doc",
"bug"
]
},
{
"login": "D1no",
"name": "Dino Scheidt",
"avatar_url": "https://avatars.githubusercontent.com/u/2397125?v=4",
"profile": "http://din.ooo",
"contributions": [
"code"
]
}
]
}
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ root.render(<Popup />);
<details>
<summary>src/pages/content/ui/index.tsx</summary>

"""tsx
```tsx
import { attachTwindStyle } from '@src/shared/style/twind';

...
attachTwindStyle(rootIntoShadow, shadowRoot);
createRoot(rootIntoShadow).render(<App />);
"""
```
</details>

[See more examples](https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/pull/244/)
Expand Down Expand Up @@ -471,6 +471,9 @@ manifest.json
<td align="center" valign="top" width="14.28%"><a href="https://github.com/govza"><img src="https://avatars.githubusercontent.com/u/1425574?v=4?s=50" width="50px;" alt="Rasul"/><br /><sub><b>Rasul</b></sub></a><br /><a href="#doc-govza" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gavinhow"><img src="https://avatars.githubusercontent.com/u/16214376?v=4?s=50" width="50px;" alt="gavinhow"/><br /><sub><b>gavinhow</b></sub></a><br /><a href="#bug-gavinhow" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/anand-schultz"><img src="https://avatars.githubusercontent.com/u/133013727?v=4?s=50" width="50px;" alt="Anand D."/><br /><sub><b>Anand D.</b></sub></a><br /><a href="#doc-anand-schultz" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.iotercom.com"><img src="https://avatars.githubusercontent.com/u/521473?v=4?s=50" width="50px;" alt="Romain Dequidt"/><br /><sub><b>Romain Dequidt</b></sub></a><br /><a href="#doc-romaindequidt" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://linkedin.com/in/jguddas"><img src="https://avatars.githubusercontent.com/u/25524993?v=4?s=50" width="50px;" alt="Jakob Guddas"/><br /><sub><b>Jakob Guddas</b></sub></a><br /><a href="#doc-jguddas" title="Documentation">📖</a> <a href="#bug-jguddas" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://din.ooo"><img src="https://avatars.githubusercontent.com/u/2397125?v=4?s=50" width="50px;" alt="Dino Scheidt"/><br /><sub><b>Dino Scheidt</b></sub></a><br /><a href="#code-D1no" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
6 changes: 6 additions & 0 deletions src/pages/content/ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createRoot } from 'react-dom/client';
import App from '@pages/content/ui/app';
import refreshOnUpdate from 'virtual:reload-on-update-in-view';
import injectedStyle from './injected.css?inline';

refreshOnUpdate('pages/content');

Expand All @@ -15,6 +16,11 @@ rootIntoShadow.id = 'shadow-root';
const shadowRoot = root.attachShadow({ mode: 'open' });
shadowRoot.appendChild(rootIntoShadow);

/** Inject styles into shadow dom */
const styleElement = document.createElement('style');
styleElement.innerHTML = injectedStyle;
shadowRoot.appendChild(styleElement);

/**
* https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/pull/174
*
Expand Down
Empty file.
8 changes: 6 additions & 2 deletions utils/plugins/custom-dynamic-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ export default function customDynamicImport(): PluginOption {
renderDynamicImport({ moduleId }) {
if (!moduleId.includes('node_modules') && process.env.__FIREFOX__) {
return {
left: `import(browser.runtime.getURL('./') + `,
right: ".split('../').join(''));",
left: `
{
const dynamicImport = (path) => import(path);
dynamicImport(browser.runtime.getURL('./') +
`,
right: ".split('../').join(''))}",
};
}
return {
Expand Down
2 changes: 1 addition & 1 deletion utils/plugins/make-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function makeManifest(config?: { getCacheInvalidationKey?: () =>
if (cacheKey) {
// Naming change for cache invalidation
manifest.content_scripts.forEach(script => {
script.css = script.css.map(css => css.replace('<KEY>', cacheKey));
script.css &&= script.css.map(css => css.replace('<KEY>', cacheKey));
});
}

Expand Down

0 comments on commit fd23d8c

Please sign in to comment.