Pattern anatomy

The scheme is http, https, file or a wildcard. The host can be a domain, a wildcard subdomain or an asterisk. The path must begin with a slash and can include a wildcard.

https://example.com/* matches only that host. https://*.example.com/* matches the base domain and subdomains. <all_urls> is a special shorthand for all supported schemes and hosts.

Match pattern examples
PatternMatchesBreadth
https://example.com/*One HTTPS hostNarrow
https://*.example.com/*Domain and subdomainsMedium
*://example.com/*HTTP and HTTPS on one hostMedium
*://*/*All HTTP and HTTPS hostsBroad
<all_urls>All supported schemes and hostsBroadest

Related pages:content script inspectorwebsite access inspector

run_at and all_frames

run_at controls when injection occurs. document_start runs before the page DOM is fully built, document_end runs after the DOM is ready, and document_idle runs later when the browser decides the page is quiet.

all_frames allows the script to run in matching iframes. That can be necessary for embedded forms or editors, and it expands where the code can observe content.

Related pages:what does all_urls meanChrome host permissions

Evaluating injection reach

Compare the pattern with the feature. A tool that improves one web app should not need every site. A password manager or content blocker may need broad reach, but it should explain how page data is handled.

The inspector lists the matched hosts, the injected files and related static findings. Use it to decide whether the script's access is proportionate.