chrome.webRequest.onBeforeRequest.addListener(function(details) {
if (localStorage.on == '1') {
return {cancel:true};
}
}, {urls: ["*://*.domain1.net/*","*://*.domain2.com/*","*://*.domain3.com/*"], types: ["script","xmlhttprequest","other"]}, ["blocking"]);
Is there a way to exclude URLs that match a certain pattern? I want to block all requests except those made to the specified 3 domains. I considered using cancel:true for all requests and allowing the exact content for the 3 domains. Do I need to be concerned about one listener taking precedence over another? How can I modify the code to return the exact content for the specified domains instead of canceling the request?