Problem with webRequest

149 views
Skip to first unread message

Ernesto Gonzalez

unread,
Jan 5, 2024, 11:39:37 AM1/5/24
to Chromium Extensions
I'm using a manifest v3 with the following permissions :
Im trying to use webRequest with one of the events like this 
chrome.webRequest.onBeforeRequest.addListener(
   (details) => {
    console.log(details);
  },
  { urls: ["<all_urls>"] },
  ["blocking"]
);
and I getting this error in the console 
1.PNG
As of Manifest V3, the "webRequestBlocking" permission is no longer available for most extensions. Consider "declarativeNetRequest", which enables use of the declarativeNetRequest API. Aside from "webRequestBlocking", the webRequest API will be unchanged and available for normal use. Policy installed extensions can continue to use "webRequestBlocking".

I need to analyze a URL before it's loaded and if it matches with my logic block or lets them into the URL. How I can do this ?
This is a portion of my manifest and I using Version 120.0.6099.130 (Official Build) (64-bit)
of Chrome 

  "manifest_version": 3,
  "icons": {
    "16": "./assets/images/favicon16.png",
    "48": "./assets/images/favicon32.png",
    "128": "./assets/images/favicon128.png"
  },
  "host_permissions": [
    "https:/\/*/*",
    "http:/\/*/*"
  ],
  "permissions": [
    "declarativeNetRequest",
    "declarativeNetRequestWithHostAccess",
    "tabs",
    "webRequest",
    "nativeMessaging",
    "activeTab",
    "contentSettings",
    "management",
    "downloads",
    "storage",
    "identity",
    "webNavigation",
    "alarms"
  ],


wOxxOm

unread,
Jan 5, 2024, 6:45:54 PM1/5/24
to Chromium Extensions, Ernesto Gonzalez
Chrome's implementation of ManifestV3 has removed webRequestBlocking for normal extensions. You'll have to patch Chrome binary or install the extension via force-install policy or abandon Chrome altogether.
Reply all
Reply to author
Forward
0 new messages