title: Chrome extension crashes when trying to access from two different windows?
body: <p>I open a chrome extension, then open a new window (incognito for example) and try to open the extension again, it crashes. I then need to reload the app through the chrome extensions page. There are no errors in this.</p>
  <p>The question is how can I work with the extension from different windows at the same time</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;manifest_version&quot;: 2,
  
      &quot;name&quot;: &quot;Such Activity&quot;,
      &quot;description&quot;: &quot;Wow&quot;,
      &quot;version&quot;: &quot;1.0&quot;,
      &quot;permissions&quot;: [&quot;tabs&quot;,&quot;webRequest&quot;, &quot;webRequestBlocking&quot;, &quot;storage&quot;, &quot;http://*/&quot;,&quot;https://*/&quot;],
  
      &quot;browser_action&quot;: {
          &quot;default_title&quot;: &quot;Click Me&quot;,
          &quot;default_popup&quot;: &quot;popup.html&quot;,
          &quot;default_icon&quot;: &quot;start.png&quot; 
      }
  }
  </code></pre>
  <p>and my popup.js</p>
  <pre class="lang-js prettyprint-override"><code>function injectTheScript() {
      console.log(&quot;start script&quot;)
      if (nfts.length &lt;= 0) {
          console.log(&quot;successfull&quot;)
          return;
      }
      id = nfts.pop()
      var newURL = &quot;url&quot;+id;
      chrome.tabs.update({url: newURL}, myTab =&gt; {
          function listener(tabId, changeInfo, tab) {
              if (tabId === myTab.id &amp;&amp; changeInfo.status == 'complete') {
                  chrome.tabs.query({active: true, currentWindow: true}, tabs =&gt; {
                      chrome.tabs.executeScript(tab.id, {file: &quot;content_script.js&quot;});
                  })
                  counter++;
                  document.getElementById('count').textContent = counter
                  console.log(&quot;hoba&quot;+counter)
                  setTimeout(injectTheScript, 7000);
              }
          };
          if (!isInjected) {
              chrome.tabs.onUpdated.addListener(listener);
              isInjected = true;
          }
      });
  }
  document.getElementById('clickactivity').addEventListener('click', injectTheScript)
  
  chrome.webRequest.onBeforeRequest.addListener(
    function(details) { 
      return { cancel: true }; 
    },
    {urls: [&quot;*://*/*checkUser&quot;]},
    [&quot;blocking&quot;]
  );
  </code></pre>
  <p>the extension crashes before I interact with it. it crashes when i click on its icon in chrome</p>