Advertisement
Guest User

Untitled

a guest
Sep 20th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Manifest:
  2. {
  3. "name": "Web req test",
  4. "description": "Blocks Facebook requests (including cdn)",
  5. "version": "1.0",
  6. "manifest_version": 2,
  7. "background": {"scripts":["bg.js"]},
  8. "permissions": ["webRequest","webRequestBlocking","*://*.facebook.com/*", "*://*.facebook.net/*", "*://*.fbcdn.net/*", "*://fbcdn.net/*", "<all_urls>"]
  9. }
  10.  
  11. Background script:
  12. chrome.webRequest.onBeforeRequest.addListener(
  13. function(details) {
  14. console.log(details.method + ' ' + details.url + ' (' + details.type + ')');
  15. return {cancel:true};
  16. },
  17. {
  18. urls: [
  19. "<all_urls>" // Quick test
  20. ],
  21. types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
  22. },
  23. ["blocking"]
  24. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement