Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Manifest:
- {
- "name": "Web req test",
- "description": "Blocks Facebook requests (including cdn)",
- "version": "1.0",
- "manifest_version": 2,
- "background": {"scripts":["bg.js"]},
- "permissions": ["webRequest","webRequestBlocking","*://*.facebook.com/*", "*://*.facebook.net/*", "*://*.fbcdn.net/*", "*://fbcdn.net/*", "<all_urls>"]
- }
- Background script:
- chrome.webRequest.onBeforeRequest.addListener(
- function(details) {
- console.log(details.method + ' ' + details.url + ' (' + details.type + ')');
- return {cancel:true};
- },
- {
- urls: [
- "<all_urls>" // Quick test
- ],
- types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
- },
- ["blocking"]
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement