Replies: 2 comments 12 replies
-
Thank you for taking the time to try out WXT and for writing up your feedback! It's very valuable, and I will be making some changes based on this. To address some of your comments for anyone else that comes across this:
You don't have to use any of the utils WXT provides, like If you were using The only change you absolutely have to make is to wrap your entrypoints in a
Yeah, it doesn't persist any data by default, but you can configure it to do so. Personally, I prefer a fresh profile during development, but this is a very common question, so maybe the majority of devs would prefer I change the default... I'll run a poll in discord and we'll see.
Yeah, chrome removed the ability to reload the background individually. See #53. As for changing content scripts... That should keep your popup open. Just checked, and it does for me. So not sure why this was happening to you.
It's possible, here's an example showing how to do it:
Haha yeah... I just need to buckle down and type all that up. There was another contributor who wanted to help improve the docs, but I haven't heard anything from them in a month... The fact you couldn't find solutions to some of these issues in the docs tells me they're not good enough, that's for sure. |
Beta Was this translation helpful? Give feedback.
-
You cant run your dev server on the actual chrome browser you are using. It does not actually launch a browser but an instance of a chrome webdriver. To be able to persist your chrome profile when you restart the server, set this on your wxt.config
You need to set the chromeProfile, userDataDir, and userProfile Here's a utility function i wrote that does this for me.
btw i'm using bun so the node std lib are preface with 'node:' |
Beta Was this translation helpful? Give feedback.
-
I want to share why I didn't make the switch from a vanilla js chrome extension workflow to wxt in the hopes of giving some insights to you, the contributors, from me, a newbie in browser extension development.
I was looking at wxt, because I wanted to use
I got wxt working with Svelte and even hash routing and was quite proud and excited to continue migrating my large background.js, content.js and popup.js
But there my excitement stopped. The way that wxt/storage is implemented meant too much work for me to make the switch because not only do I need to refactor the code, I also need to learn how wxt/storage is implemented.
Furthermore the documentation was quite lacking. Many places where I was hoping for an answer were still under construction.
Also, the DX wasn't as good as I expected it to be. On new compiles a fresh Chrome instance was opened every time and I was forced to pick a default search engine (even though I did it before already) before I could use the extension. The popup didn't stay open while the dev server was running if I saved the background.ts or content.ts and it didn't seem possible to explicitly set "optional_host_permissions" in the wxt config manifest.
I was hoping I would be able to instantly open the extension in my current default browser, open dev tools for my popup instance and have hot module reloading work regardless of file type (popup.js or background.ts etc.).
In the end I decided to set up Svelte + svelte-hash-router with vite configured such that it builds to dist on every save. This way I only have to manually reload the application in chrome://extensions on every change. But that I could live with. This was less migration work for me to deal with.
Hope this feedback helps!
Beta Was this translation helpful? Give feedback.
All reactions