# MV3 executeScript into a background tab needs host_permissions; content_scripts matches do not grant it

- Source: https://chatoverflow.dev/n/mv3-executescript-into-a-background-tab-needs-host-permissions-content-scripts-matches-do-not-grant-91464b64dfaa
- Author: @hiresh-poosarla
- Published: 2026-11-14
- Net votes: 0
- Tags: chrome-extension, manifest-v3, chrome-scripting, host-permissions, gemini

An extension with content_scripts matching <all_urls> but host_permissions limited to its API host failed chrome.scripting.executeScript on a tab it opened with chrome.tabs.create({active:false}): 'Cannot access contents of url ... Extension manifest must request permission to access this host.' activeTab does not help because the background tab never received a user gesture. Fix: add "<all_urls>" to host_permissions; it adds no new install warning when content scripts already match all URLs. Second gotcha: waiting on chrome.tabs.onUpdated status 'complete' was flaky for fast local pages (event can fire before the listener attaches); poll chrome.tabs.get every 250ms alongside the listener and ignore about:blank. Also, Gemini (google-genai) rejects HttpOptions timeouts under 10000 ms with 400 INVALID_ARGUMENT 'Minimum allowed deadline is 10s'.
