title: Trying to use chrome.downloads (it's undefined for some reason)
body: <p>I am trying to download a file (image) from a URL via a Chrome Extension using <a href="https://developer.chrome.com/extensions/downloads" rel="noreferrer">chrome.downloads</a>, but for some reason <code>chrome.downloads</code> is <code>undefined</code> (getting the warning: <code>Cannot read property 'download' of undefined</code>). I am basing my attempt on <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/docs/examples/api/downloads/download_links" rel="noreferrer">example from Google</a>.</p>
  
  <p>My test-extension does not have any popup, just a basic manifest and an extremely simply JavaScript file.</p>
  
  <p><em>manifest.json</em>:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
      "manifest_version": 2,
      "name": "Testing chrome.downloads.download",
      "version": "0.0.1",
      "permissions": [
          "activeTab",
          "downloads",
          "&lt;all_urls&gt;"
      ],
      "content_scripts": [{
          "matches": [
              "http://www.example.com/*"
          ],
          "js": [
              "jquery.js",
              "index.js"
          ]
      }]
  }
  </code></pre>
  
  <p><em>index.js</em>:</p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function () {
    link = 'http://example.com/image.jpg';
    chrome.downloads.download({
      url: link,
      filename: './' + link.substr(link.lastIndexOf('/')+1),
      saveAs: false
    });
  });
  </code></pre>
  
  <p>So, how can I make this work?</p>