title: Chrome extension: chrome.scripting.executeScript not working
body: <p>for some reason my <code>executeScript</code> function is not working.
  This is my code:</p>
  <pre><code>async function scrape_get_url(){
      console.log(&quot;Getting url: &quot; + from_url);
      var tab_id;
      chrome.tabs.create({ &quot;url&quot;: from_url}, function(newTab){
          tab_id = newTab.id;
          console.log(&quot;Checking for tab url update&quot;);
      });
      chrome.tabs.onUpdated.addListener( function(tabId, info) {
          if(tabId == tab_id &amp;&amp; info.url){
              console.log(&quot;Executing scrape script&quot;);
              console.log(&quot;tab id:&quot; + tab_id);
              console.log(&quot;updated tab url:&quot; + info.url);
              chrome.scripting.executeScript({
                  target: {tabId: tab_id},
                  function: scrape
              });
          }
      });
  }
  function scrape(){
      console.log(&quot;Getting Element...&quot;);
  }
  </code></pre>
  <p>This is my output:</p>
  <pre><code>Getting url: https://developer.chrome.com/docs/extensions/mv3/getstarted
  Checking for tab url update
  Executing scrape script
  tab id:293
  updated tab url:https://developer.chrome.com/docs/extensions/mv3/getstarted/
  </code></pre>
  <p>I have an <code>onUpdated</code> listener due to a chrome bug, as stated <a href="https://stackoverflow.com/questions/68611210/navigate-tab-to-a-url-and-execute-script-inside">here</a>. Also, the reason I put the <code>onUpdated</code> function outside of the <code>create</code> function's callback, is because according to another question on StackOverflow(that I can't find anymore :/ ), putting the <code>executeScript</code> within the <code>create</code>'s callback will not run the script.</p>
  <p>My permissions are set correctly in the manifest file.</p>