jelmervdl / translatelocally-web-ext

TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers.
https://addons.mozilla.org/en-GB/firefox/addon/translatelocally-for-firefox/
Mozilla Public License 2.0
66 stars 3 forks source link

Chromium support (manifest v2) #18

Closed jelmervdl closed 2 years ago

jelmervdl commented 2 years ago

Related to #10.

Let's see how far we can get if we naively try to get the extension working in Chrome.

Manifest v2 still seems to work! But is probably not accepted in the Chrome extension web store.

Goal is to stay compatible with Firefox as well, and avoid as much browser-specific code or UI as possible.

jelmervdl commented 2 years ago

Getting somewhere, but this is still all manifest v2 stuff. Need to get it to v3 if we ever want to publish it officially for Chrome. One upside of v3: I can get rid of all the promisify calls again :)

Screenshot 2022-04-19 at 23 18 33

yes, it is quite a bit slower in Chrome than it is on Firefox nightly. I'm almost tempted to bring back MAX_WORKERS > 1.

jelmervdl commented 2 years ago

Like, in the current state we can't publish it on Chrome's addon page, but it will keep working till something 2023. And it might work in other Chromium-based browsers. That's already quite something I think.

jelmervdl commented 2 years ago

There's no way to distribute this as a crx that can be installed in chrome. For that, it needs to be in the Chrome extension store. However, I can't upload it there (even unlisted) as only manifest v3 is allowed for new extensions.

However, you can use this extension in Chrome if you use the unpacked extension, and load it in developer mode. Not very user friendly, but functional.