Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

(thanks :) )

> As long as you're here: I was told that the old extension API was way too broad, locking in a lot of design choices that were not really considered from the "do we want to maintain this for years and years" perspective. And that the new one is much more focused and considered. Is that the case?

Definitely. The old extension mechanism was basically "here is the toolkit we are using to build Firefox, come and plug anywhere/replace anything". If my memory serves correctly, at the time, Mozilla Browser/Firefox was (almost) the only browser doing any kind of extensions (I'm not counting M3 and a few experimental/academic browsers), so there was no real precedent on how to do this.

For a time, it worked extremely well. After all, much of today's Firefox is built from add-ons that were progressively integrated in the browser. And then, progressively, we realized that there were drawbacks to this "anything goes" approach, but we couldn't fix things because that would mean breaking thousands of add-ons.

So, after many years trying to postpone the inevitable for the sake of our users, we finally switched to a much better defined API. This WebExtension API is much smaller, much better documented, and does not expose internals-only stuff. Which means that now, we can fix internals-only stuff without breaking the API. Which should make the life of both Firefox developers, add-on developers and users much better :)




Thank you for your work on Firefox.

> This WebExtension API is much smaller, much better documented, and does not expose internals-only stuff.

It also doesn't expose a lot of stuff that's useful and not tied to Firefox internals in any way.

The browser is one of the most heavily used programs on people's computers. Integrating it with the rest of your system and workflow can have huge payoffs in user experience and productivity. The traditional XUL-based extension system, while not always pretty, allowed for that. WebExtensions are severely lacking here and some of that seems by design.

As an example, I'm still trying to figure out a non-insane way to implement something akin to the It's All Text extension that allows editing text areas on websites using a proper text editor.


As a fellow fan of It's All Text, I've looked into this a little bit, though I never got around to implementing anything. You're looking for the "Native Messaging" feature: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Na...

I just checked the It's All Text github repo, and their suggested replacement is a thing called GhostText¹, which actually seems a good deal fancier that IAT ever was.

¹: https://github.com/GhostText/GhostText


Looking at GhostText and its editor integration scripts, those basically work by running a websocket server on localhost. Implementing access controls seems to be left as an exercise for the reader.

If I understand the native messaging API correctly, nothing in there requires the presence of any networking daemon. The browser just execs a program you can communicate with using JSON messages on stdin/stdout. That is already a lot better than I thought.


I tried that, too. There is no such method at this time that doesn't involve setting up something in between the browser and the editor to marshal between the browser's native messaging API [1] and the editor's desire to operate on text files. I don't think that's insane at all, but the complexity involved did exceed my frankly passing desire to get IAT back - I barely ever use it any more. It shouldn't take a reasonably experienced extension developer more than a day or so to implement, though, I would think.

[1] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Na...


I believe IE also had extensions (the channel bar in Windows 98, and later toolbars and ActiveX that partly lead to Firefox becoming so popular). It certainly didn't have as much flexibility as XUL though!


That's possible. ActiveX was powerful but... problematic :)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: