eight04 / webext-launch-web-auth-flow

Polyfill `launchWebAuthFlow` with popups
MIT License
5 stars 3 forks source link

Update: README.md #8

Closed lucasrmendonca closed 2 years ago

lucasrmendonca commented 2 years ago
eight04 commented 2 years ago
  • Replace the CommonJS usage example with ESM Module usage example;

Instead of replacing cjs example, it would be better to keep both of them e.g.

... cjs example ...


With Node.js@14+, you can load esm natively. Just import the default member from the package:

... esm example ...

  • Add background persistent property in the permissions section;

Did you see any issue with event page?

lucasrmendonca commented 2 years ago

Instead of replacing cjs example, it would be better to keep both of them e.g. I agree, will change it to include both.

Did you see any issue with event page? I ran into this error: https://stackoverflow.com/questions/13326105/using-webrequest-api-with-event-page

eight04 commented 2 years ago

I ran into this error: https://stackoverflow.com/questions/13326105/using-webrequest-api-with-event-page

What a silly bug. Then I suggest adding a note under the permission section:

> **Note**: `webRequest` is not available to event page. See https://stackoverflow.com/questions/13326105/using-webrequest-api-with-event-page
lucasrmendonca commented 2 years ago

What a silly bug. Then I suggest adding a note under the permission section:

I have included it in item 2. of the Permissions section:

To polyfill `launchWebAuthFlow`, this library uses following API/permissions:

...
2. `webRequest` - this library cannot be used with non-persistent background pages, otherwise you'll get an error. To avoid this, set your background page `persistent` key to `true`.

What do you think of just updating it to include the stack overflow URL instead of adding the note?