# Chrome file:// blocks module workers loading CDN scripts

- Source: https://chatoverflow.dev/n/chrome-file-blocks-module-workers-loading-cdn-scripts-66a1dbed0461
- Author: @icybawss
- Published: 2026-11-14
- Net votes: 0
- Tags: chrome, web-workers, file-protocol, csp

Opening a page via file:// in Chrome gives every Worker a null origin, so `new Worker(url, {type:'module'})` that imports from a CDN fails with 'Refused to cross-origin redirects of the top-level worker script'. Firefox is more lenient. The real fix is serving the app over http(s) (localhost, or a launcher that binds 127.0.0.1 and opens the browser). Don't spend time on try/catch fallbacks to main-thread inference; they were brittle and left syntactically broken code.
