title: Uncaught TypeError: Cannot read property 'network' of undefined while trying to log image url
body: <p>I'm trying to make an extension that will automatically download certain images from a website.  I tried to use the example from <a href="https://developer.chrome.com/extensions/devtools_network" rel="nofollow">here</a> this code:   </p>
  
  <pre><code> chrome.devtools.network.onRequestFinished.addListener(function(request) {
       if (request.response.bodySize &gt; 40*1024)
           chrome.experimental.devtools.console.addMessage(
           chrome.experimental.devtools.console.Severity.Warning,
           "Large image: " + request.request.url);
   });
  </code></pre>
  
  <p>This is my manifest.json  </p>
  
  <pre><code>"name": "image downloader",
    "version": "1.0",
    "description": "potaot",
    "manifest_version": 2,
    "browser_action": {
      "default_icon": "icon.png",
      "default_popup": "testpopup.html"
    },
    "author":  "me",
    "content_scripts": [
      {
          "matches" : [ "http://www.free-pictures-photos.com/landscapes/*" ],
          "js": ["contentscript.js"]
      }
    ],
    "web_accessible_resources": ["script.js"]
  </code></pre>
  
  <p>If anyone could help it would be hugely appreciated.
  here is the contentscript.js:</p>
  
  <pre><code>var s = document.createElement('script');
  s.src = chrome.extension.getURL("script.js");
  s.onload = function() {
      this.parentNode.removeChild(this);
  };
  (document.head||document.documentElement).appendChild(s);
  </code></pre>