What a content script can do

Content scripts share the page's DOM but run in an isolated JavaScript world by default. They can read and modify page content, observe user input and communicate with the extension's background context.

The match patterns decide where this happens. A pattern for one domain is narrow; patterns with wildcard schemes or all_urls are broad and deserve attention.

Related pages:content script match patterns explainedextension website access inspector

Reading match patterns

A match pattern has a scheme, host and path. https://example.com/* matches pages on that host. https://*.example.com/* includes subdomains. <all_urls> covers every supported scheme and host.

The inspector separates content-script matches from host_permissions, because injection access and API access are related but not identical. It also reports run_at and all_frames when declared.

Related pages:what does all_urls meanChrome host permissions checker

Questions to ask about injected scripts

Does the feature need to run on every page or only on the sites it lists? Does the script read forms, cookies or messages? Does it inject HTML or load remote code? Does it send page content to a server?

The report answers what can be observed statically. It does not claim that page data was collected. For extensions that handle sensitive accounts, prefer narrow matches and visible, documented behavior.

  1. 1

    Identify the match patterns

    List every host or wildcard the content script targets.

  2. 2

    Check the timing

    document_start runs earlier than document_idle and may see different page state.

  3. 3

    Review frame behavior

    all_frames extends injection into embedded frames.

  4. 4

    Inspect the script

    Use the linked findings and file names to review data access.