antfu-collective / vitesse-webext

⚡️ WebExtension Vite Starter Template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix HMR in contentScript App by using an iframe

louisremi opened this issue · comments

Clear and concise description of the problem

Since WebExtension's Manifest v3, HMR in content script is broken and disabled in this repo. (see manifest.ts).

Suggested solution

Although I don't have a solution to prevent having to manually reload the extension when updating the contentScript, there is a solution to inject an app in the current tab with functional HMR: the solution is to inject an iframe with a source pointing to another Vue app in the repo, similar to the options or popup app.

I have a working POC over on my fork: https://github.com/louisremi/vite-react-webext-with-sidebar (where I also switched from Vue to React for my personnal needs).

Let me know if you think this could be an interesting fix/addition to this repo

Alternative

No response

Additional context

No response

Validations