In Chrome, we use chrome.offscreen to have access to Worker. Unfortunately, that means yet another layer of indirection: Translations now go from the page -> content-script -> background-script -> offscreen script -> worker -> wasm runtime ðŸ˜
Todo:
[x] Restore tab state when the service worker is unloaded
[ ] Communicate translation cancellation to worker in the Offscreen page: problem is that AbortSignal doesn't make it across the message passing boundary.
What I'd really really like:
[ ] Tests! I can't keep testing two browsers manually :(
For some reason you need to enable the access to statmt and translatelocally explicitly. Quite annoying. I wonder if that's something missing in the installation flow because I'm running in developer mode or not.
Use manifest v3 for Firefox, and Chrome.
In Chrome, we use
chrome.offscreen
to have access toWorker
. Unfortunately, that means yet another layer of indirection: Translations now go from the page -> content-script -> background-script -> offscreen script -> worker -> wasm runtime ðŸ˜Todo:
What I'd really really like: