3 ms·
I used WebExtension polyfill[0] when adapting my FF addon to Chrome and admittedly all the intricate differences between APIs still costed me half a day of work
by klntsky 5y ago
I used WebExtension polyfill[0] when adapting my FF addon to Chrome and admittedly all the intricate differences between APIs still costed me half a day of work.
I managed to have it done with only a few places where I branch on navigator.vendor, but If I wanted to ship different versions to AMO and CWS, I'd make use of something like DefinePlugin[1] for webpack to include/exclude code based on build target.
[0] https://github.com/mozilla/webextension-polyfill/ https://github.com/mozilla/webextension-polyfill/
[1] https://github.com/webpack/docs/wiki/list-of-plugins#defineplugin https://github.com/webpack/docs/wiki/list-of-plugins#definep...
- falafelite 5y agoYeah that’s the polyfill extension I use! Thanks for the validation, I am finding that I have to make manual changes anyway as well. Thanks for sharing the DefinePlugin, it looks like it could be quite useful