awesome-webextension / webpack-target-webextension

WebExtension Target for Webpack 5. Supports code-splitting and HMR.
MIT License
46 stars 5 forks source link

Use `browser.*` APIs when possible #16

Closed fregante closed 3 years ago

fregante commented 3 years ago

https://github.com/crimx/webpack-target-webextension/blob/cbb1185e2e8935205a1f36d862bde80e1b96a3c3/lib/background.js#L3

For this reason, I dropped the check and the duplicate code

crimx commented 3 years ago

Hi, first off, thanks for the PR!

The webpack-target-webextension, as its name suggests, is for WebExtension target. The chrome namespace is not part of the WebExtension spec. For the time being, major browser vendors also implement the chrome namespace because Google Chrome still dominates the web browser market and most of the current WebExtension APIs are heavily inspired by Chrome Extension.

For this reason, I would prefer using the browser namespace if possible and fallback to chrome.

crimx commented 3 years ago

Thanks!