-
-
Save Xrymz/79a7ca8c7a365bf7c29908fb2ad52b05 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