Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMR on contentScript not working on Firefox #42

Open
privatenumber opened this issue Oct 18, 2021 · 0 comments
Open

HMR on contentScript not working on Firefox #42

privatenumber opened this issue Oct 18, 2021 · 0 comments

Comments

@privatenumber
Copy link
Contributor

privatenumber commented Oct 18, 2021

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

  1. Clone repo and pnpm i
  2. Run npm run dev in one shell
  3. Run npm run start:firefox in another shell
  4. Navigate to random site and open dev console
  5. Add console.log(1) to src/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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant