Hi, folks. I am responsible for a Chrome extension with over ten million users. Our extension makes heavy use of a background script, which will be going away with manifest v3.
I am trying to get to the point where I can do useful work, but so far it has evaded me.
I am testing on Chrome Canary, currently 78.0.3882.0.
When I drag the current production version into chrome://extensions all is good, because it's manifest v2.
When I change my manifest version to 3 I get a pop-up error:
The "background.scripts" key cannot be used with manifest_version 3. Use the "service_worker" key instead.
Changing this:
"background": {
"scripts": ["background.js"]
},
... to this:
"service_worker": {
"scripts": ["background.js"]
},
... loads without a pop-up error but gets me two errors:
1) Unrecognized manifest key 'service_worker'.
2) The maximum currently-supported manifest version is 2, but this is 3. Certain features may not work as expected.
Reading the entrails here:
... suggests it's going to be service_worker.script and not scripts, so I try this:
"service_worker": {
"script": "background.js"
},
This does not work, nor does this:
"service_worker": {
"script": ["background.js"]
},
... nor this blind stab:
"service_worker": "background.js"
Enabling Experimental Extension APIs, here:
chrome://flags/#extension-apis
does not seem to help with either error, nor does enabling Experimental Web Platform Features from chrome:flags, like this:
chrome://flags/#enable-experimental-web-platform-features
I've also tried from the command line:
open -a "Google Chrome Canary" --args --enable-experimental-web-platform-features
... but I don't see it in chrome:flags, so I don't know if it's working or not.
Please, how can I get to the point where Chrome Canary sees service_worker as a valid manifest key?
Thanks very much,
--Kent