I'm looking for a solution to the match pattern rules for making a Google Chrome Extension - I'm trying to block websites such as Pinterest, the problem is that Pinterest has a million TLDs and rather than write out...
"*://pinterest.com/*, *://pinterest.se/*, *://pinterest.co.uk/*..
etc Forever
I'm trying to block all of Pinterest's Top Level Domains.
Using "*://pinterest.*/*"
or "*://*.pinterest.*/*"
does not work.
var blockedUrls = [ "*://*.pinterest.se/*, *://*.pinterest.com/*"];
var host = "https://www.google.com"
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
return {redirectUrl: host };
},
{
urls:blockedUrls,
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
},
["blocking"]
);
The above code works. Anyone got any idea how to do this, any nudge in the right direction would be appreciated. Many Thanks.