HNHacker News
TopNewBestAskShowJobs

cezaraugustodev

154 karma · joined January 26, 2021

submissionscomments
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Safari and Firefox are next, feel free to subscribe to the issues below so you know when Extension.js supports them.

- Safari https://github.com/cezaraugusto/extension.js/issues/46 - Firefox https://github.com/cezaraugusto/extension.js/issues/5

cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
In your case, Extension.js can help by managing the configuration details that are usually overlooked in general web development.

After copying a few files from the Chrome extension documentation site, you'll need to manually enable "developer mode" in your browser and add these files. If you make changes to your code, seeing the updates live requires manually reloading the various contexts that a browser extension can influence. Additionally, if you want to test your extensions on multiple browsers, you must do this manually for each one.

If you plan to use package dependencies like TypeScript or a JavaScript framework, you'll either have to rely on an existing abstraction framework for extensions and learn new techniques, or create your own configuration using tools like webpack, Parcel, esbuild, or another code compiler. At this point, developing browser extensions can become complex and frustrating.

Extension.js simplifies this by automating the process of bundling an extension in a browser ready for development. It comes with auto-reload support for every context, including parts of the browser that are not HTML/CSS/JavaScript. It also has built-in support for code dependencies such as TypeScript and React, where a simple installation enables your extension to have support without any setup wizardry. And it runs on multiple browsers at once.

Hope that clarifies things, and I'm happy to answer more questions :)

cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
FYI There is a new issue to track progress and enable Safari support https://github.com/cezaraugusto/extension.js/issues/46
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Thanks for that!
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
That's great! I'm glad you will give it a try
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
That's interesting, what do you mean? An abstraction for the manifest apply dev defaults or instructions on how each major part should work?
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Thank you! The ecosystem for developing extensions could be so much better, hope we can help with that
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Haha, thanks! It’s not in the immediate plans, but meanwhile, I'm sure there are some good libraries on npm for that :)
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
I'm glad to hear!
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Totally relate. Extension development should be fun, right? Hope Extension.js can help you with your next project!
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Extension.js can help you creating a new extension using React in no time:

npx extension create my-react-extension --template=react

But I guess it doesn't make it any easier to modify the behavior of fancy modern web sites :_(

cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Great question!

The biggest difference, in my opinion, is that Plasmo is a framework, which means you have to learn its abstractions and rely on specific samples tailored for these abstractions to create new extensions. There are config files and specific rules to follow that are not necessarily related to browser extensions.

On the other hand, Extension.js allows developers to create extensions using the standard extension APIs and abstracts only the configuration files, without the need to learn the tooling specifics. This way, a sample from Chrome or MDN that works with a manifest file as the source of truth requires no refactoring to work with Extension.js, making it easier to get started and prototype new projects.

cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Yes, the manifest.json is a required file for all extensions, and the package.json file provides necessary package metadata.

web-ext is excellent, but it seems there are no plans for the project to support more browsers than it currently does. On the other hand, Extension.js plans to support all major vendors.

Except for Firefox support, which is in progress, I believe Extension.js offers parity with all core functionalities of web-ext, but it goes further by providing built-in support for React and TypeScript. All you need to do is add the correct dependencies to get up and running.

Additionally, Extension.js provides comprehensive extension reload support, including changes to the manifest.json file and the service_worker background. This feature sets it apart from similar tools, including web-ext, which do not offer this capability.

cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
The plugin for Firefox is on the way, but any community support is highly appreciated.
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Thanks! Firefox support will come in the next update. Stay tuned! :)
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Haha glad to hear that
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
No worries :) but Chrome and Edge are indeed different browsers. Support for Firefox and Safari is next.
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
That's great feedback, thank you. Will consider the removal.
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Sure thing! There will be support for Firefox very soon
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
HN has a character limitation for the post title and changing the word made the title fit just fine :)
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Thank you! I'm glad you liked the readme as well :D
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Thanks for the kind words!
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Thanks! I do plan to support all major browsers in the near future, including Safari :)
cezaraugustodev··on Show HN: I made a CLI tool to create web extensions with no build configuration
Thanks a lot!

You can run your Mozilla Add-On on Chrome or Edge by adding a --polyfill flag, but for now you need to manually add the extension to Firefox. I do plan to support Firefox in the near future, but no browser runner available at the moment.