Is it possible to have more than one target in the urls argument in the webRequest. How?
This is an example that did not work and gave me this error:
The webRequest.addListener filter doesn't overlap with host permissions.
This is the example code main.js
:
myArray=["yahoo.com", "google.co.uk"];
patterns=[];
for (var x=0; x<myArray.length; x++)
{
var aURL="\"https://*."+myArray[x]+"/*\""
patterns.push(aURL);
}//end for
console.log("the array: "+patterns);
function logURL(requestDetails)
{
console.log("inside logURL");
console.log("*******************************");
console.log("Loading: " + requestDetails.url);
console.log("*******************************");
}//end logUTL
browser.webRequest.onBeforeRequest.addListener(
logURL,
{urls: patterns,
types: ["main_frame"]}
);
This is the manifest:
{
"manifest_version": 2,
"name": "test",
"version": "1.0",
"description": "",
"background": {
"scripts": ["main.js"]
},
"icons": {
"64": "icons/myicon.png"
},
"permissions":[
"<all_urls>",
"activeTab",
"tabs",
"activeTab",
"webRequest"
]
}