Expose only the extension assets that web pages or external extension contexts must access.
Extension.js merges user-declared web_accessible_resources with build-discovered requirements and applies target-specific manifest normalization.
| Capability | What it gives you |
|---|---|
| MV2/MV3 schema handling | Support both array and object WAR shapes by manifest version |
| Build-aware merging | Combine declared resources with required build/runtime entries |
| Path normalization | Resolve manifest WAR paths to target-safe output references |
| Security control surface | Keep access rules explicit by resources and matches |
manifest.json fileIf assets are already imported through supported content-script/build paths, Extension.js can add the required WAR entries automatically. For explicit external access, declare resources manually.
public/ and leading / conventions into extension output-safe paths.public/ are copied by the public-asset flow and can be declared from extension root paths.chrome.runtime.getURL()/browser.runtime.getURL() for runtime-safe URL creation.matches scope to domains that actually require access.