title: How to load content script in chrome extension v3
body: <p>I'm migrating my v2 extension to v3. Now, the first thing that is not clear to me is how the content script is loaded into the page. I've implemented it as follows (background script):</p>
  <pre><code>chrome.action.onClicked.addListener(tab =&gt; {
      chrome.windows.create({
          // Just use the full URL if you need to open an external page
          url: chrome.runtime.getURL(&quot;hello.html&quot;),
           type: &quot;panel&quot;, height: 200, width:200
      }, (win) =&gt; {
          chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
              const currTab = tabs[0];
              if (currTab) {
                  chrome.scripting.executeScript({
                      target: {tabId: currTab.id},
                      files: ['/content.js'],
                  }, () =&gt; {  });
              }
          });
      });
  });
  </code></pre>
  <p>I think that this example is my best attempt :)
  So, when I run this code I get the following error in the console:</p>
  <pre><code>Unchecked runtime.lastError: Cannot access contents of url &quot;&quot;. Extension manifest must request permission to access this host.
  </code></pre>
  <p>Here is my manifest:</p>
  <pre><code>{
      &quot;name&quot;: &quot;Hello, World!&quot;,
      &quot;version&quot;: &quot;1.0&quot;,
      &quot;manifest_version&quot;: 3,
      &quot;background&quot;: { &quot;service_worker&quot;: &quot;background.js&quot; },
      &quot;action&quot;: {
          &quot;default_icon&quot;: { 
              &quot;16&quot;: &quot;icon16.png&quot;
          }
      },
      &quot;permissions&quot;: [
          &quot;tabs&quot;,
          &quot;bookmarks&quot;,
          &quot;unlimitedStorage&quot;,
          &quot;activeTab&quot;,
          &quot;scripting&quot;
      ],
      &quot;optional_permissions&quot;: [],
      &quot;host_permissions&quot;: [
          &quot;*://*/*&quot;
      ],
      &quot;web_accessible_resources&quot;: [
          {
              &quot;resources&quot;: [&quot;/content.js&quot;],
              &quot;matches&quot;: [],
              &quot;extension_ids&quot;: [],
              &quot;use_dynamic_url&quot;: true
          }
      ]
  }
  </code></pre>
  <p>If I'm on the right path here, there must be something missing in my manifest. Any suggestions?</p>