On this page
Before packaging a browser extension, check that its manifest, bundled code, and resource paths point where the release build expects. A development endpoint, broad match pattern, or missing asset can otherwise make it into the distributed package.
This checklist covers a manual review and a few local searches. It does not assume that every URL in an extension is public—or even intended to be fetched.
Key Takeaways
- Review URL patterns by their purpose: host permissions, content-script matches, and web-accessible resource matches do different jobs.
- Inspect the release artifact, not just source files or a development build.
- Compare discovered hosts and asset paths with an explicit release inventory; investigate staging endpoints, wildcards, and missing files.
- URL parsing can reveal components, but it cannot establish whether a permission is needed or a resource is safe.
- The current Chrome Extensions and MDN documentation could not be consulted for this article. Confirm manifest syntax and browser-specific behavior against the current documentation before release.
1. Inventory the manifest declarations
Open the manifest from the actual release build. For each declaration, record what feature needs it, which environment it belongs to, and whether it is required or optional.
| Declaration to inspect | Review question |
|---|---|
host_permissions and optional_host_permissions | Which extension feature needs access to each host, and when is that access needed? |
permissions and optional_permissions | Are there host patterns alongside API permissions in the manifest format you support? Are optional permissions actually requested at the appropriate time? |
content_scripts | Do matches and any exclusions target the intended pages? Do the listed scripts and styles exist in the packaged build? |
web_accessible_resources | Which packaged resources are exposed, and to which matching origins or extension IDs? Is each exposure necessary? |
externally_connectable | If present, which external pages or extensions can communicate with the extension? Are they intended? |
| Icons, background scripts, action pages, and other resource references | Do these paths resolve to the intended files in the package? |
Check the applicable manifest version and target browser when interpreting these fields. In particular, web-accessible resource declarations and their syntax can differ between browsers or manifest versions. A match pattern is not necessarily an ordinary URL: interpret wildcard and path semantics according to the target browser's documentation rather than relying on a general URL parser.
Do not treat every manifest pattern as a URL to visit. For example, a content-script match describes where injection may apply, while a web-accessible resource match controls which external contexts may access listed extension resources. Neither declaration proves that a network endpoint exists or is publicly reachable. Internal extension paths likewise refer to packaged resources, not ordinary public web pages.
Advertisement
2. Compare patterns with an approved host inventory
Make a short list of the hosts and page origins each release feature is supposed to use. Include separately controlled environments and identify which ones must not appear in the production package. For each manifest pattern and discovered URL, ask:
- Is this the expected production host, including its subdomain and scheme?
- Does the declaration use a wildcard or
<all_urls>where a narrower scope would work? If broad access is necessary, document why. - Does a staging, preview, local, or test host remain in the release build?
- Is an optional permission preferable for a feature the user might never enable?
- Does the URL contain a port, path, query, or fragment that changes what the feature does?
For example, a fictional release might permit https://api.example.invalid/ but not https://staging.example.invalid/. Those names illustrate a comparison, not reachable services. A wildcard that covers both hosts deserves review even if the production host itself is correct.
A parser helps separate the scheme, hostname, port, and path of an ordinary URL. It does not tell you whether the extension needs access, whether a server is trustworthy, or whether a browser interprets a match pattern as you expect.
3. Search the packaged build
The following commands assume a Unix-like shell, Python 3, and ripgrep (rg). Replace build/release with your actual unpacked release directory. Run them locally: the results may contain internal hostnames or sensitive URL parameters.
First, inspect the manifest in a readable form:
python3 -m json.tool build/release/manifest.json
Then search the artifact for common URL and environment markers:
rg -n -i --hidden --no-ignore \
-e '<all_urls>' \
-e 'https?://' \
-e 'wss?://' \
-e 'chrome-extension://' \
-e 'moz-extension://' \
-e '\*://' \
-e 'localhost' \
-e '127\.0\.0\.1' \
-e 'staging' \
build/release
These commands have not been executed for this article. Review each match in context against your inventory; a match is a lead, not automatically a defect. Adjust the search terms for your organization’s preview domains, loopback addresses, test markers, and other schemes. rg can return a nonzero status when it finds no matches, so distinguish that case from an execution error.
Static search has limits: binary files, generated or encoded strings, runtime configuration, and URLs assembled from separate pieces can escape these patterns. Minified bundles and source maps can also make findings harder to interpret. Inspect build configuration and exercise relevant features in a controlled environment rather than treating a clean search as proof of safety.
4. Check packaged paths and runtime URLs
Compare the file inventory of your development and release builds. This Bash example assumes both directories already exist:
diff -u \
<(cd build/dev && find . -type f -print | LC_ALL=C sort) \
<(cd build/release && find . -type f -print | LC_ALL=C sort)
A difference is not necessarily a problem: release builds may intentionally rename, hash, or omit files. Trace each relevant manifest reference and code-generated path to its corresponding release file. Check icons, popup and options pages, background entry points, injected scripts and styles, and resources listed as web-accessible. For resource declarations that use patterns, verify the actual packaged files the pattern is intended to cover.
Also inspect code that builds extension URLs at runtime. A relative path that worked in development may refer to a renamed or absent release asset. Depending on the browser and configuration, generated extension URL forms can differ; do not hard-code an extension identifier or assume a development URL will be stable in the installed release.
Advertisement
5. Exercise the release package
Load or install the built package using the supported development or testing workflow for each target browser. In an authorized test environment:
- Exercise each feature that requests a permission, injects a content script, fetches a remote resource, or loads a packaged asset.
- Inspect the extension’s relevant console and network diagnostics for failed requests, unexpected hosts, and incorrect paths. Some extension resources are local and will not behave like public network requests.
- Test permitted and non-permitted page origins where web-accessible resources or external messaging are involved. Confirm intended access without assuming that a failed request explains its own cause.
- Check both the presence and absence of optional permissions where applicable, including the feature’s behavior if a request is denied.
- Redact tokens and sensitive query parameters before sharing logs or screenshots.
A failed load may have several causes, including a missing file, an incorrect path, permission scope, browser policy, server availability, or network restrictions. Diagnose the actual failure instead of broadening permissions immediately.
Common Mistakes
- Auditing only the source manifest. Build substitutions can change the manifest or embed different endpoints in bundled code.
- Treating a pattern as proof of reachability. Permissions and match patterns describe browser behavior; they do not establish that a public service exists.
- Assuming every packaged file is web-accessible. Exposure depends on the extension configuration and browser behavior. Conversely, do not put secrets in a package on the assumption that unexposed files are secret.
- Removing every wildcard without checking behavior. Narrow unnecessary scope, but test the features that depend on it and account for browser-specific pattern rules.
- Using a parser as a security decision. A parsed hostname does not prove that a permission is justified or that content from that host is safe.
Best Practices
Keep an approved inventory of release hosts, permissions, exposed resources, and the features that need them. Review changes to that inventory alongside manifest and build changes. Test the actual packaged artifact in every supported browser, and consult current browser documentation for the manifest version you ship.
Conclusion
To check browser extension resource URLs before release, combine a manifest review, a search of the packaged build, path verification, and controlled runtime checks. Each catches different mistakes; none should be replaced by URL parsing alone.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.