-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support content_scripts[i].world in manifest #744
Conversation
🦋 Changeset detectedLatest commit: ab3edb5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I'd like for CRXJS to support this feature, but there's more work to be done before this PR will work. For now, I'm going to decline merging this b/c I don't want to create extra confusion. Why Not?Vite is an ES modules build tool, but Chrome Extension content scripts are plain scripts, not ESM. We can support ESM in content scripts using (function () {
'use strict';
const injectTime = performance.now();
(async () => {
if ("")
await import(
/* @vite-ignore */
chrome.runtime.getURL("")
);
await import(
/* @vite-ignore */
chrome.runtime.getURL("vendor/vite-client.js")
);
const { onExecute } = await import(
/* @vite-ignore */
chrome.runtime.getURL("src/content.ts.js")
);
onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } });
})().catch(console.error);
})(); Notice the use of What ElseWe need to find a way to use Vite to build an IIFE script. I'm sure this can be done, but I haven't been able to put in the hours to get it working. PRs are appreciated. |
@TheColaber can you continue work on it? |
Resolves #741
Without this change it will error in the console which blocks all usage of rpce