title: chrome.scripting.executeScript not working in my manifest v3 Chrome Extension
body: <p>I have an extension where I call</p>
  <pre><code>function doScript(window) {
    chrome.scripting.executeScript(
      {
        target: {tabId: window.tabs[0].id},
        files: ['myscript.js'],
      });
  }
  </code></pre>
  <p>myscript.js simply has</p>
  <pre><code>alert(&quot;Made it&quot;)
  </code></pre>
  <p>but I get no alert in my tab.</p>
  <p>If I change the tabId to something random like 123</p>
  <pre><code>  chrome.scripting.executeScript(
      {
        target: {tabId: 123},
        files: ['myscript.js'],
      });
  </code></pre>
  <p>then I get an error &quot;Unchecked runtime.lastError: No tab with id: 123&quot;</p>
  <p>So it looks like my tabId is right, but for some reason myscript.js is not triggering an alert.</p>
  <p>If I mess up the script name like this</p>
  <pre><code>  chrome.scripting.executeScript(
      {
        target: {tabId: window.tabs[0].id}},
        files: ['ttttttttttt.js'],
      });
  </code></pre>
  <p>I get &quot;runtime.lastError: Could not load file: 'ttttttttttt.js'.&quot;</p>
  <p>I tried looking through the console logs and the only thing I see is this error upon clicking but it looks like a red herring.</p>
  <p>&quot;Unchecked runtime.lastError: Cannot access contents of url &quot;&quot;. Extension manifest must request permission to access this host.&quot;
  <a href="https://github.com/GoogleChrome/web-vitals-extension/issues/54" rel="noreferrer">https://github.com/GoogleChrome/web-vitals-extension/issues/54</a></p>
  <p>Here is my manifest</p>
  <pre><code>{
      &quot;manifest_version&quot;: 3,
      &quot;name&quot;: &quot;pokemon bokemon&quot;,
      &quot;description&quot;: &quot;&quot;,
      &quot;version&quot;: &quot;0.3.0&quot;,
      &quot;action&quot;: {
          &quot;default_popup&quot;: &quot;popup.html&quot;
      },
      &quot;icons&quot;: {
          &quot;16&quot;: &quot;icon16.png&quot;,
          &quot;32&quot;: &quot;icon32.png&quot;
      },
      &quot;permissions&quot;: [
          &quot;tabs&quot;,
          &quot;storage&quot;,
          &quot;scripting&quot;,
          &quot;activeTab&quot;,
          &quot;cookies&quot;
      ],
      &quot;host_permissions&quot;: [
          &quot;*://*/*&quot;,
          &quot;&lt;all_urls&gt;&quot;
      ],
      &quot;options_page&quot;: &quot;options.html&quot;
  }
  </code></pre>
  <p>EDIT: Apparently it's a bug in chrome/manifest v3. Opened a bug here: <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1191971" rel="noreferrer">https://bugs.chromium.org/p/chromium/issues/detail?id=1191971</a></p>