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

Improve usage documentation #378

Closed
fregante opened this issue Apr 10, 2022 · 0 comments
Closed

Improve usage documentation #378

fregante opened this issue Apr 10, 2022 · 0 comments

Comments

@fregante
Copy link
Contributor

fregante commented Apr 10, 2022

After #376 is merged, I'll send another PR to simplify/condense the various import methods because currently each section is too long to follow.

#351 wasn't documented either and that's probably the easiest usage for most webpack users since it works across contexts.

The usage would be prefaced with a section like:

  • without a bundler:
    • static: add browser-polyfill.js to manifest.json
    • dynamic: inject file via executeScript before other files
  • bundler usage:
    • simple: use const browser = require('webextension-polyfill')
    • invisible webpack usage: use ProvidePlugin
    • polyfill the global: use require('webextension-polyfill/register')

And the ESM usage section should be dropped because there's nothing ESM-related about it, type=module effectively doesn't change anything here. It's also rather confusing because the example is an HTML page but it does not mention how to load such HTML page (which is also deprecated)

@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2024
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