For those wondering how it works, it seems to be a blacklist. Here's the crux of it:
chrome.webRequest.onBeforeRequest.addListener(details => {
// ...
// Is domain white listed
if (isDomainWhitelisted(domains[details.tabId])) {
return { cancel: false };
}
return { cancel: true };
}, { urls: blacklistedUrls }, ['blocking']);
It's kind of sad how much boilerplate is required to write a simple extension. I wonder if there's a framework for saving labor while building cross-compatible browser extensions. Then again, maybe the world doesn't need yet another JavaScript framework.