Creating a new Firefox add-on: XUL or Jetpack?
If you were going to start developing a new Firefox add-on today, would you still use XUL/JS or would you start开发者_Go百科 using Jetpack, the new add-on framework?
The XUL way of creating add-ons will continue to exist on Firefox 4 but Jetpack is clearly building steam and I imagine it will become the only way of creating add-ons in the future.
Is it already the time to start looking to switch/migrate to Jetpack?
JetPack and XUL are not mutually exclusive. JetPack is a set of APIs that you can ship with an add-on that are tested by Mozilla and guaranteed to work. I'd suggest you start with JetPack, and if you need to do something more powerful, you can start adding XUL and other JS files to accomplish what you need. JetPack is designed to be simpler, but you can also step into the scarier world of extension development without issue.
I don't know yet Jetpack, but I coded a large extension for Firefox two years ago using XUL and it was really, really painfull.
I think Jetpack has to be better and simplier, and it's worth it to give it a try.
It depends on the size and scope of your add-on. If you believe it to be fairly simple, than I would start with XUL and only switch to the framework when you hit walls and find yourself saying "there must be a better way!"
I haven't used Jetpack, but I do agree with others here that XUL isn't always pleasant. It's amazing how often the documentation is missing some obviously key piece of information. Jetpack may smooth that over for you. Alternatively, you could help improve the documentation. :)
精彩评论