Lusito / webextension-polyfill-ts

This is a TypeScript ready "wrapper" for the WebExtension browser API Polyfill by Mozilla
zlib License
392 stars 23 forks source link

export default? #56

Closed justnewbee closed 3 years ago

justnewbee commented 3 years ago

since webextension-polyfill exports browser as default, can u add a default export so that it is more consistent?

Lusito commented 3 years ago

Not sure I can do that without breaking backwards compatibility. Will take a look.

joelpurra commented 3 years ago

@justnewbee: it seems to me that the fix you need is simply targeting the original default export of webextension-polyfill, instead of browser in webextension-polyfill-ts. If this change "just works" depends on how you package your extension though.


I'll go one step further and suggest not importing and re-exporting webextension-polyfill at all. The type definition would still be there, but for the global browser, the way it is created/used by webextension-polyfill. This would remove the direct dependency on webextension-polyfill for webextension-polyfill-ts, but it would still be a peer dependency for those who consume webextension-polyfill-ts. See #57 for a pull request.

Lusito commented 3 years ago

This is solved now with the move to @types/webextension-polyfill