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

Is there a way to disable the insertion of the webextension-polyfill into the scripts? #147

Open
3 of 6 tasks
mclberlin opened this issue Nov 18, 2022 · 0 comments
Open
3 of 6 tasks

Comments

@mclberlin
Copy link

mclberlin commented Nov 18, 2022

Type:

  • bug
  • feature
  • enhancement
  • question

I'm going to open a PR:

  • yes
  • no

Description:
I'm using vue-cli-plugin-browser-extension, which in turn is using your reloader plugin.
That plugin also provides the webextension-polyfill. It does so by registering it as a webpack plugin and loader - which then can simply be deleted in the user's own webpack chaining.
It took me quite a while to figure out why the polyfill would still be inserted into my scripts - until I digged into the source code and found out that it's done by the webpack-extension-reloader, here.

This is frustrating, since I would like to use the webextension-polyfill directly and standalone, for 2 reasons:

  1. I use 2 separate builds, one for FF, one for chrome. For FF I don't wish to include this polyfill, for obvious reasons.
  2. For chrome I don't want to have the polyfill inserted into each and every script, but rather have it only once, standalone -> then I can simply insert it whereever needed (i.e. via manifest.json as a content script or as a background script, or via tabs.executeScript or via <script> of some extension page html.

I'd love to stick to the current usage of vue-cli-plugin-browser-extension (and therefore of webpack-extension-reloader as well), so it would be great if you could provide some feedback on wether/how I can avoid your polyfill insertions.

Thx a lot

Update:
It just dawned to me that the polyfill won't be included into a production build, since the webpack-extension-reloader is only used for development.
I can live with having the polyfill inserted into my scripts in development mode -> Will have to check if there are any unwanted side-effects when using my own polyfill implementation (i.e. only using it for prod).

@mclberlin mclberlin changed the title Is there a way no disable the insertion of the webextension-polyfill into the scripts? Is there a way to disable the insertion of the webextension-polyfill into the scripts? Nov 18, 2022
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