How to test your local JavaScript on the live site
Sometimes a bug only shows up on the real site, with real data. Instead of deploying to test a fix, you can make Chrome load your local build in place of the production file, or replace a file's contents entirely. This used to be Resource Override's job; ProperHeader does it on Manifest V3.
Both methods below are Pro features.
Option 1: redirect the file to your dev server
Best when you have a dev server running, because your changes show up on reload.
- Open Full editor and click Prod JS → localhost under Quick start, or add a row under Redirects.
- Set From to the production file, for example
https://cdn.example.com/app.js. - Set To to your local file, for example
http://localhost:8080/app.js. - Reload the production page. Chrome now loads your local build.
Redirect a whole folder with regex
Switch the match type to regex and use a capture group:
From: ^https://cdn\.example\.com/(.*\.js)$ To: http://localhost:8080/$1
Every script under the CDN is now loaded from the same path on your dev server.
Option 2: replace the file's contents
Best for a quick experiment, or for mocking an API response without a server.
- Under File overrides, click + Add.
- Enter the file URL, for example
https://example.com/static/app.js, and choose the type: JavaScript, CSS, JSON, text or HTML. - Paste your replacement contents.
- Reload the page.
The Mock an API response recipe does this for a JSON endpoint, which is handy when the back end isn't built yet.
If the override doesn't load
- Content-Security-Policy. File overrides are served as
data:URLs. If the page's CSP forbids that, Chrome refuses the file. Fill in Remove CSP on for that page and it works while your profile is on. See removing CSP. - Mixed content. An
https://page loadinghttp://localhostis usually allowed, because Chrome treats localhost as secure. Other plain-http hosts will be blocked. - Size. Each override can be up to about 1.4 MB, and the response is always HTTP 200 with only a Content-Type header.
- Service workers. Files served from a service worker's cache never reach the network. Bypass the service worker in DevTools (Application tab) while testing.
- Integrity attributes. If the script tag has an
integrity="sha384-…"hash, a changed file fails the check. Override the HTML page too, or test on a build without SRI.
Questions
Is there a Resource Override alternative for Manifest V3?
Yes. ProperHeader's File overrides and Redirects cover the same jobs: replace a file's contents, or send a production file to your local server.
Can I override a JSON API response in Chrome?
Yes. Add a File override for the endpoint URL, choose JSON, and paste the response body. It's returned with HTTP 200 and a JSON Content-Type.
Why is my overridden script blocked?
Usually the page's Content-Security-Policy forbids data: URLs. Fill in 'Remove CSP on' for that page. Subresource-integrity hashes and service-worker caches can also stop an override.