Last active
September 27, 2021 14:17
-
-
Save hubgit/7655707 to your computer and use it in GitHub Desktop.
Chrome extension to block common third-party background requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urls = [ | |
'*://graph.facebook.com/*', | |
'*://platform.twitter.com/*', | |
'*://*.google-analytics.com/*' | |
]; | |
var response = function() { | |
return { cancel: true }; | |
} | |
chrome.webRequest.onBeforeRequest.addListener(response, { urls: urls }, ['blocking'] ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Block Hosts", | |
"version": "0.1", | |
"manifest_version": 2, | |
"background": { | |
"scripts": [ | |
"background.js" | |
] | |
}, | |
"permissions": [ | |
"webRequest", | |
"webRequestBlocking", | |
"<all_urls>" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment