---
title: "Expose as few extension files to web pages · Agent Wranglers"
url: https://agentwranglers.se/playbook/desktop-apps/browser-extensions/web-accessible-resources
id: DSK-32
level: Recommended
updated: 2026-10-22
build: a2a6bdfed830
tokens: 760
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Expose as few extension files to web pages as you can

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Browser extensions](https://agentwranglers.se/playbook/desktop-apps/browser-extensions.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: DSK-32
- Level: Recommended
- Chapter: [Browser extensions](https://agentwranglers.se/playbook/desktop-apps/browser-extensions.md)
- Rule: List under `web_accessible_resources` only the files a web page must load, with `matches` set to the exact sites that need them. In Chrome, set `use_dynamic_url` to true.
- Check: A test reads the built manifest. No entry has `<all_urls>` or `*://*/*` in `matches`, and a content script loads every listed file. A test page on a site outside `matches` fails to fetch each listed file.
- How: By default no extension file is reachable from web pages. Chrome warns that each exposed file lets a site detect the extension, which helps fingerprint the user, and lets it probe the file for holes. A dynamic ID changes every session, so a site cannot test a fixed address. Never expose a page that acts on its address or on messages, such as an options page. Review this list with the permissions of [Ask for the fewest permissions the extension needs](https://agentwranglers.se/playbook/desktop-apps/browser-extensions/extension-permissions.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JSON example

```json
{
  "web_accessible_resources": [
    {
      "resources": ["badge.svg"],
      "matches": ["https://app.example.com/*"],
      "use_dynamic_url": true
    }
  ]
}
```

## Sources

- [Chrome, Manifest web_accessible_resources](https://developer.chrome.com/docs/extensions/reference/manifest/web-accessible-resources)

## Related rules

- DSK-14 [Ask for the fewest permissions the extension needs](https://agentwranglers.se/playbook/desktop-apps/browser-extensions/extension-permissions.md) in Desktop apps and extensions

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/desktop-apps/browser-extensions/web-accessible-resources">Agent Wranglers desktop apps and extensions playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Protect the store accounts that publish the extension](https://agentwranglers.se/playbook/desktop-apps/browser-extensions/extension-store-accounts.md)
- Next: [Insert text into web pages as text from content scripts](https://agentwranglers.se/playbook/desktop-apps/browser-extensions/content-script-dom.md)
- [Browser extensions](https://agentwranglers.se/playbook/desktop-apps/browser-extensions.md)
