Skip to content
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

PGlite does not work in MV3 browser extensions that operate on other origins #471

Open
callum-gander opened this issue Dec 14, 2024 · 0 comments

Comments

@callum-gander
Copy link

So, I could be wrong here but as I understand it:

  • In order to function across tabs and ensure transactions are enforced, we need to run the web worker https://pglite.dev/docs/multi-tab-worker
  • Due to MV3, we can't spin up web workers from background scripts and due to cross-origin policies, we also can't spin up the web worker if we're running it within a content script on another origin, e.g. let's say this is a youtube extension, the content script wouldn't be able to spin up the web worker there as it'll

This makes it seem that for browser extensions that use MV3, there isn't a way to run the web worker unless we're running the extension on origins that we specifically own and can modify the content policy. Am I missing something here? I've gone down a huge rabbit hole today trying to get PGlite working on my extension and due to this limitation it feels like it won't work and, due to the limitations of MV3, can't work. Is this correct? Would be great to get a second opinion here on whether this is true and if so add it to the docs so others know not to try this out. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant