Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
WXT: Next-Gen Web Extension Framework (wxt.dev)
37 points by nateb2022 on Dec 12, 2024 | hide | past | favorite | 10 comments


Running browser extensions through minifiers is pretty representative of the absurdity of the NodeJS/NPM cargo cult.

No one who's writing an open source browser extension should be using minification, and no one who's installing a browser extension should be installing one that's closed source. Previously:

> Most people aren't (or at least feel they aren't) able to take a hardline stance about only using free software, but if there's one area of your digital life you should be able to apply it to, it's browser extensions.

<https://news.ycombinator.com/item?id=41998764>


How can you be sure that the code running in your browser is the same code that's in the repo for the extension?

Does using a bundler count as minification? One that takes all the files in the packages and links them into fewer files.


Oh, this is a framework, in the JavaScript sense, not a new scheme for web extensions. So it doesn't need Google's approval.


Buult a small extension recently, and spent a while trying crxjs and some various rollup plugins and other options.

It was taking a long long time, and I didn't have many dependencies I needed. So I just wrote the code by hand, unbundled. Using esm wasn't too too hard, but you have to use dynamic imports & a chrome specific getURL. https://stackoverflow.com/a/53033388


For those who have worked a lot with web extensions, I’m curious to hear what their experiences are with frameworks. There are quite a few that I’ve come across:

- WXT

- Plasmo: www.plasmo.com

- CRXJS: https://crxjs.dev/vite-plugin

- Web Extension Vite Starter: https://github.com/antfu-collective/vitesse-webext

- Bedframe: https://github.com/nyaggah/bedframe

to name a few. Has anyone used multiple of these? If so, how do they compare? What makes one stand out above the others?


we moved away from Plasmo to WXT and saw significant improvements:

https://chatgptwriter.ai/blog/migrate-plasmo-to-wxt


Thanks for this write up


WXT is heavily inspired by Nuxt (with emphasis on DX) and we gladly use both at my company.


I decided to try this recently on my first browser extension and so far the experience has been good.

Sometimes the websocket connection for the hot reload dies but apart from that I've been quite impressed.

Just abstracting away the different manifest files and using the webextension polyfill is all I need and it works.

The only shame is how abysmal the experience is in Firefox I find myself preferring to debug the extension in Chrome as getting to the debugger in Firefox is such a pain. And I use Firefox as my primary browser so it's not because of a Chrome bias I say this. The Firefox folks could really improve the UX here.


> using the webextension polyfill

What for? All browsers now have a promised API

> The Firefox folks could really improve the UX here

I wouldn't hold my breath.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: