offline-qr-code icon indicating copy to clipboard operation
offline-qr-code copied to clipboard

Chrome/ium support

Open ENT8R opened this issue 6 years ago • 6 comments

Are there some plans to extend this add-on as a Chrome extension? This article lists all incompatibilities between Firefox and Chrome extensions: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities

But I already did some testing with this polyfill: https://github.com/mozilla/webextension-polyfill and it works without problems (except that you need to modify the manifest.json a little bit because not all properties are supported by Chrome...)

Or is there a reason why this add-on should not become a Chrome extension?

ENT8R avatar Apr 27 '18 19:04 ENT8R

Or is there a reason why this add-on should not become a Chrome extension?

Only that I likely won't adjust design and stuff for it, i.e. do not actively adjust stuff for it and rather only do minimal tests in Chromium. But I am all for standards, so if the add-on can be adjusted in a sane way to work in Chrome, that's all fine. I would then also publish it there…

As for JS code I would argue to only use polyfills. I.e. E.g. menu is also not supported in Chrome/ium (but the standardized version), but only contextMenu. So there rather than changing everything to contextMenu, one needs to write a (I think) small polyfill, which redirects all calls… I personally never wrote polyfills, but I think that is possible.

And we would maybe need some adjustments so we generate a different ZIP for Chrome/ium, so we don't have to ship that additional (polyfill) JS in the Firefox version.

rugk avatar Apr 27 '18 21:04 rugk

As for the manifest.jsonI think we could even have two versions, one packaged with Chrome/ium and one with Firefox… That file is small and all translations and so on are in other files anyway.

rugk avatar Apr 27 '18 21:04 rugk

I did some further research and I think we have to drop this idea. In Chrome it is not possible at all to open a popup programmatically which is a huge problem for this add-on as there are quite some actions which depend on this. For more information see: https://bugs.chromium.org/p/chromium/issues/detail?id=399859 https://stackoverflow.com/a/5576816/8575129

ENT8R avatar Apr 28 '18 12:04 ENT8R

Well… we could just leave out support for this. Then we just have no context menus and so on – kinda like version 1.1. right now.

rugk avatar Apr 28 '18 12:04 rugk

BTW https://github.com/mozilla/webextension-polyfill may help, but it's likely still a little more to do… (Edit: Noticed this has already been linked above.)

rugk avatar Apr 14 '19 09:04 rugk

Resources:

  • https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities
  • https://extensionworkshop.com/documentation/develop/porting-a-google-chrome-extension/

rugk avatar Jul 07 '21 18:07 rugk