title: Firefox WebExtention executeScript runAt ignorance
body: <p>I'm writing small WebExtention for Firefox browser. It turns out Firefox handles the <code>runAt</code> property differently for content scripts from <em>manifest.json</em> vs. from <code>browser.tabs.executeScript</code> method.</p>
  
  <p><em>content-script.js</em>:</p>
  
  <pre class="lang-js prettyprint-override"><code>console.log('content script fired!');
  </code></pre>
  
  <p>background script <em>settings-script.js</em>:</p>
  
  <pre class="lang-js prettyprint-override"><code>function handleUpdated(tabId, changeInfo, tabInfo) {
      var pageVar = "console.log('executeScript fired!'); 
      var executing = browser.tabs.executeScript(tabId, {
          code: pageVar,
          runAt: "document_start"
      });
  }
  
  browser.tabs.onCreated.addListener(handleUpdated);
  browser.tabs.onUpdated.addListener(handleUpdated);
  </code></pre>
  
  <p><em>test-page.html</em>:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;test my behaviour&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script type="text/javascript"&gt;
          console.log('start very first page script');
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><em>manifest.json</em>:</p>
  
  <pre class="lang-json prettyprint-override"><code>"permissions": [
    "activeTab",
    "storage",
    "tabs",
    "http://*/*", 
    "https://*/*",
    "file://*/*"
  ],
  "background": {
    "scripts": ["background/settings-script.js"]
  },
  "content_scripts": [
    {
      "matches": ["&lt;all_urls&gt;"],
      "js": ["content-script.js"],
      "run_at": "document_start"
    }
  ],
  </code></pre>
  
  <p>The console output looks like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>'content script fired!'
  'start very first page script'
  'executeScript fired!'
  </code></pre>
  
  <p>So, why does Firefox ignore my <code>runAt</code> property and keep executing script on <code>document_idle</code> when I inject it with <code>tabs.executeScript()</code> programmatically? </p>
  
  <p>Is there something I've missed?</p>