Hacker News new | past | comments | ask | show | jobs | submit | cezaraugustodev's comments login

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


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 :)


FYI There is a new issue to track progress and enable Safari support https://github.com/cezaraugusto/extension.js/issues/46


Thanks for that!


That's great! I'm glad you will give it a try


That's interesting, what do you mean? An abstraction for the manifest apply dev defaults or instructions on how each major part should work?


I don't know exactly what the the person you're replying to had in mind, but support for different parts of the manifest varies (especially in Manifest V3). While it's possible to write a single manifest that works in all browsers (with warnings), doing so requires more than a little specialized knowledge.

For example, Firefox does not currently support the `optional_host_permissions` top level manifest key. To work around this, developers can declare their optional host permissions in both the `optional_host_permissions` array for Chrome compatibility and in the `optional_permissions` array for Firefox/Safari compatibility.

Another example is that currently only Chrome supports `background.service_worker` in stable releases. To work around this, developers can write their MV3 background scripts in a way that's compatible with both service workers and event pages, then declare both in the manifest like so:

```json { "background": { "scripts": ["background.js"], "service_worker: "background.js" } } ```


Yep, that's it! I settled for generating the manifest.json through a script, since at some point adding something only supported by one browser would cause an error in the other, though I think that may have been remedied now.


Thank you! The ecosystem for developing extensions could be so much better, hope we can help with that


Would love to hear your thoughts on how to improve it ;)


Haha, thanks! It’s not in the immediate plans, but meanwhile, I'm sure there are some good libraries on npm for that :)


I'm glad to hear!


Totally relate. Extension development should be fun, right? Hope Extension.js can help you with your next project!


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

Search: