wOxxOm
unread,Feb 4, 2023, 11:39:40 AM2/4/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, mayjr...@gmail.com, olive...@google.com, Chromium Extensions
The
documentation says "
Only available for unpacked extensions". The word "
available" means the very existence of the JS object, it doesn't mean availability of the functionality like an abstract concept, which is why your code throws on reading `undefined.addListener`. You can suggest disambiguating the documentation in their repository at the end of the page there's a bug link.
chrome.declarativeNetRequest.onRuleMatchedDebug?.addListener((info) => {
There's also an overarching problem in ManifestV3 with seeing and debugging JS errors in the service worker when installing/reloading an extension. The lack of this feature signifies that ManifestV3 is still in the early pre-alpha phase for the most hardcore enthusiasts, especially since this was working properly in ManifestV2. I see only one slightly involved workaround, which probably should be added to the documentation:
- Open any visible page of your extension like the popup or options,
or manually go to chrome-extension://xxxxx/manifest.json where xxxxx is the id of the extension shown in the webstore URL (cfjflhlmcklbjpggmcphmjiolakbmafa for the extension linked in the previous messages) as well as in chrome://extensions page when `developer mode` switch is enabled in the top right corner.
- Open devtools for this page by right-clicking on an empty space inside the page, then clicking `Inspect`
- Go to Console inside devtools and register the service worker explicitly by running the following code:
navigator.serviceWorker.register((b=chrome.runtime.getManifest().background).service_worker, {type: b.type||'classic', scope: '/'})
- Now the console should show all the errors which you can click to go to the source code.