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.
| Pattern | Matches | Breadth |
|---|---|---|
| https://example.com/* | One HTTPS host | Narrow |
| https://*.example.com/* | Domain and subdomains | Medium |
| *://example.com/* | HTTP and HTTPS on one host | Medium |
| *://*/* | All HTTP and HTTPS hosts | Broad |
| <all_urls> | All supported schemes and hosts | Broadest |
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.