0

This is my manifest.json

{
  "manifest_version": 2,
  "name": "MyExt",
  "version": "1.0",
  "permissions": ["http://*/*", "https://*/*", "webRequest", "webRequestBlocking"],
  "background": [
    {
      "scripts": [
        "js/background.js"
      ],
      "persistent": true
    }
  ],
  "content_scripts": [
    {
      "matches": [
        "<all_urls>"
      ],
      "js": ["js/content.js"]
    }
  ]
}

background.js:

chrome.webRequest.onBeforeRequest.addListener(
  function(details){
    console.log('test');
    return {cancel: false};
  },
  {urls: [ "http://*/*", "https://*/*" ]},
  ["blocking"]
);

I assume, this should log in the console every request Chrome is making. But I never see any 'test' in my console... It drives me really crazy...

  • try the simpler code [here](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/onBeforeRequest#Examples) – Jaromanda X Feb 05 '17 at 13:04
  • I did. No output in console. I believe this should log every url (also css, and images) on every website I visit and print it out to the console, right? – Messi Of DevOps Feb 05 '17 at 13:09
  • FYI the content script works as expected. – Messi Of DevOps Feb 05 '17 at 13:10
  • There are multiple [consoles for your extension](http://stackoverflow.com/a/38920982/3773011). Each of those consoles shows output from different portions of your extension. You will often need to look in more than one console, perhaps even several consoles, to get a complete picture of what is happening in your extension. – Makyen Feb 05 '17 at 15:41

0 Answers0