Hi. I’m trying to use onBeforeRequest to block an incoming request, and when debugging it works (sometimes).
This is the manifest file
{
"manifest_version": 2,
"name": "WBlist",
"version": "0.1",
"permissions": [
"webRequest",
"webRequestBlocking",
"tabs",
"webNavigation",
"browsingData",
"browserSettings"
],
"background": { "scripts": ["wblist.js"] }
}
And this the wblist.js
console.log("Add-on loaded");
browser.webRequest.onBeforeRequest.addListener((details) => {
console.log(details);
return { cancel: true };
}, { urls: ["<all_urls>"] }, ["blocking"]);
Idk what I do that it works for a few minutes and then I reload or load the addon in the debugger it doesn’t work anymore.
I’m also trying to use redirectUrl, but the changes to the manifest also screw up the functioning of the script. Plz help.