title: Chrome extension to Firefox extension
body: <p>I have developed a Chrome extension
  On Chrome everything works as I expect</p>
  <p>I am now trying to migrate the extension to Firefox</p>
  <p>It tells me that the developed extension is compatible with Firefox (I used this link <a href="https://www.extensiontest.com/" rel="nofollow noreferrer">https://www.extensiontest.com/</a>)</p>
  <p>However, I have some problems
  I have a devtools_script (&quot;VariableGrid.js&quot;) which sends messages to the ContentScript via chrome.tabs.query</p>
  <pre><code>chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
  chrome.tabs.sendMessage(chrome.devtools.inspectedWindow.tabId, { from: &quot;FromExample&quot;, message: &quot;MessageExample&quot; }, (response) =&gt; {
  ......
  });
  });
  </code></pre>
  <p>My ContentScript replies to the message like this</p>
  <pre><code>chrome.runtime.onMessage.addListener(
  (request, sender, sendResponse) =&gt; {
  ......
  });
  </code></pre>
  <p>On Firefox chrome.tabs is undefined
  I tried using browser.tabs but it's the same</p>
  <p>I read that tabs can only be used on background script</p>
  <p>Why does this work on my Chrome extension and not on Firefox?</p>
  <p>If I tried to move that piece of code to the background script I would still have a problem:</p>
  <blockquote>
  <p>chrome.devtools.inspectedWindow.tabId is undefined</p>
  </blockquote>
  <p>my Manifest is like this</p>
  <pre><code> {
    &quot;browser_specific_settings&quot;: {
      &quot;gecko&quot;: {
        &quot;id&quot;: &quot;addon@example.com&quot;,
        &quot;strict_min_version&quot;: &quot;42.0&quot;
      }
    },
    &quot;name&quot;: &quot;xxxx&quot;,
    &quot;description&quot;: &quot;xxxx&quot;,  
    &quot;version&quot;: &quot;0.0.0.1&quot;,
    &quot;browser_action&quot;: {
        &quot;default_popup&quot;: &quot;Popup.html&quot;
    },
    &quot;manifest_version&quot;: 2,
    &quot;background&quot;: {
      &quot;scripts&quot;:[&quot;jquery.min.js&quot;, &quot;background.js&quot;],
      &quot;persistent&quot;: true
    },
    &quot;content_scripts&quot;: [
      {
        &quot;matches&quot;: [&quot;&lt;all_urls&gt;&quot;],
        &quot;js&quot;: [&quot;jquery.min.js&quot;, &quot;Content.js&quot;]
      }
    ],  
    &quot;web_accessible_resources&quot;: [
      &quot;Content.js&quot;
    ],
    &quot;devtools_page&quot;: &quot;Devtools.html&quot;,
    &quot;permissions&quot;: [
      &quot;webRequest&quot;,
      &quot;webRequestBlocking&quot;,
          &quot;tabs&quot;,
          &quot;activeTab&quot;,
          &quot;notifications&quot;,
          &quot;storage&quot;,
          &quot;http://*/&quot;,
          &quot;https://*/&quot;,
          &quot;&lt;all_urls&gt;&quot;
    ]
  }
  </code></pre>