HMR on contentScript not working on Firefox
privatenumber opened this issue · comments
Hiroki Osame commented
Description
HMR on content scripts isn't working for me in Firefox with the current setup.
This comment explains that Firefox caches the content script so this hack is necessary (contentScript removal & background script), but interestingly, content script HMR works fine if I remove this hack.
Reproduction
- Clone repo and
pnpm i
- Run
npm run dev
in one shell - Run
npm run start:firefox
in another shell - Navigate to random site and open dev console
- Add
console.log(1)
tosrc/contentScripts/index.ts
Expectation is for 1 to be logged without refreshing the page, but it does not.
Environment
$ npx envinfo --system --binaries --browsers
System:
OS: macOS 11.6
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 181.58 MB / 64.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
Yarn: 1.22.11 - ~/.nvm/versions/node/v14.16.1/bin/yarn
npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
Browsers:
Chrome: 94.0.4606.81
Firefox: 93.0
Safari: 15.0
Could it be that Firefox no longer caches in the latest release?