Skip to content

Commit

Permalink
fix: missing browser in shadow-root file (#1317)
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron <[email protected]>
  • Loading branch information
1natsu172 and aklinker1 authored Dec 31, 2024
1 parent 4e4f99d commit 58145e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/wxt/src/utils/content-script-ui/shadow-root.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @module wxt/utils/content-script-ui/shadow-root */
import { browser } from 'wxt/browser';
import { ContentScriptContext } from '../content-script-context';
import type { ContentScriptUi, ContentScriptUiOptions } from './types';
import { createIsolatedElement } from '@webext-core/isolated-element';
Expand Down Expand Up @@ -91,10 +92,9 @@ export async function createShadowRootUi<TMounted>(
* Load the CSS for the current entrypoint.
*/
async function loadCss(): Promise<string> {
// @ts-expect-error: getURL is defined per-project, but not inside the package
const url = browser.runtime.getURL(
`/content-scripts/${import.meta.env.ENTRYPOINT}.css`,
);
const url = browser.runtime

Check warning on line 95 in packages/wxt/src/utils/content-script-ui/shadow-root.ts

View check run for this annotation

Codecov / codecov/patch

packages/wxt/src/utils/content-script-ui/shadow-root.ts#L94-L95

Added lines #L94 - L95 were not covered by tests
// @ts-expect-error: getURL is defined per-project, but not inside the package
.getURL(`/content-scripts/${import.meta.env.ENTRYPOINT}.css`);
try {
const res = await fetch(url);
return await res.text();
Expand Down

0 comments on commit 58145e6

Please sign in to comment.