1

I am having trouble migrating my manifest v2 to v3.

Basically, my extension is downloading some files when a specific url pattern is matched.

I've migrated my old manifest to this:

"permissions": [
    "webRequest",
      "downloads",
      "notifications",
      "storage"
  ],
  "options_page": "options.html",  
  "background": {
    "service_worker": "background.js"
  }

However I still have this error:

Unchecked runtime.lastError: You do not have permission to use blocking webRequest listeners. Be sure to declare the webRequestBlocking permission in your manifest.

But I cannot add webRequestBlocking because then I get another error telling me v2 is deprecated.

I am using a blocking request listener in my service_worker file:

chrome.webRequest.onBeforeRequest.addListener(
    callback, {
    urls: ["<all_urls>"],

},["blocking"]);

How would I migrate that to the v3 manifest?

Felix D.
  • 4,811
  • 8
  • 38
  • 72
  • 1
    In ManifestV3 this feature can be used only in policy-installed extensions. There's no good solution otherwise as ManifestV3 was designed by idealists who disregarded 99% of practical needs for webRequest so it's unlikely to change anytime soon, if ever, but you can try reporting the problem on https://crbug.com and suggest adding an `action` to declarativeNetRequest API to download the matching URL. Another (better?) place might be https://github.com/w3c/webextensions. – wOxxOm Oct 24 '22 at 13:08
  • @wOxxOm thats what i figured :( I will see if I can use an async approach. thanks for your input on this! – Felix D. Oct 24 '22 at 14:07

0 Answers0