I'm Aza Raskin @aza. I make shiny things. I simplify.

I'm VP at Jawbone, focusing on health.

 

What If… It Was Easy To Write Firefox Extensions

Writing extensions is labor intensive. Even as a veteran web developer, I feel trepidation at the thought of diving into the boiler-plate code, wading through the XUL world, and restarting Firefox uncountable times. There are tools out there to mitigate some of these problems—like Ted Mielczarek’s Extension Wizard, and Mark Finkle’s FUEL—but they feel like fresh frosting on a stale, left-out-since-last-Thursday birthday cake.

Developer extroadinare, Atul Varma, said it best: “I hereby classify restarting Firefox during development as a ‘barbaric measure’”. Of course, restarting Firefox to install extensions is like-wise barbaric.

As a simple learn-to-write-extensions project, I decided to make a Gmail notifier. All I want it to do is and notify me—in a humane way—when a new email came in. As I dug into the the extension world, I found myself day-dreaming: What incredible places could the web go, as an open platform, if extending the web was as easy as writing for the web? What if my knowledge as a web developer was all I needed to extend Firefox? What if writing a Gmail notifier was as easy as:

function gmailNotifier() {
  var url = "http://mail.google.com/mail/feed/atom";

  ajaxGet(url, function(rss) {
    var firstEntry = $(rss).find("entry").get(0);

    var newEmailId = $(firstEntry).find("id").text();
    var subject    = $(firstEntry).find("title").text();
    var author     = $(firstEntry).find("author name").text();
    var summary    = $(firstEntry).find("summary").text();

    if( newEmailId != globals.lastEmailId ) {
      var title = author + ' says "' + subject + '"';
      displayMessage(summary, title);
    }

    globals.lastEmailId = newEmailId;
  });
}

function onStartup() {
  globals.lastEmailId = null;
  setInterval( gmailNotifier, 15*1000 );
}

Well, it isn’t that easy. Yet. *wink*

RT @aza What If… It Was Easy To Write Firefox Extensions | Follow @aza on Twitter | All blog posts

View all 119 comments


If it were easy, then I’d be out of a job – knock that talk off! :-)



skierpage

Is it possible to use the firefox -app trick to start a new XULRunner instance of Firefox (or a browser “lite”) while leaving your regular browser, and much of the shared library code, in memory? That would save some start-up time and loss of context. (I’d love to be able to do it to quickly test bugs against an empty profile.)



Kelly

I am filled with hope :-)



Byron

Hmmm interesting, especially liked the birthday cake analogy :D

It would be nice if Mozilla didn’t require its entire chrome to be reloaded in order to register another package.

going slightly off-topic here:
I couldn’t help noticing your use of jQuery in the example, whats the general practice for including JavaScript libraries? do many developers do it? if so what would be the best way? I know jquery already provides some help in this area but Im still not sure what would be considered best practice in this case.



rpgfan3233

On 2008-05-23 at 8pm, skierpage wrote:
> Is it possible to use the firefox -app trick to start a new
> XULRunner instance of Firefox (or a browser “lite”)
> while leaving your regular browser, and much of the
> shared library code, in memory? That would save some
> start-up time and loss of context. (I’d love to be able to
> do it to quickly test bugs against an empty profile.)

I’m not sure if it is possible, but I know you can have two different Firefox instances of different profiles using the -no-remote flag:

#Start a new Firefox instance using the profile name
# ‘Default’ without affecting a currently running profile.
#
#Note that you can’t run the same profile concurrently
# even with this trick.
firefox -no-remote -P “Default”



Ryan Paul

It’s a pity that bug 336551 makes E4X unusable for this sort of thing, because it would be way better than something like $(rss).find. If you scrub the XML so that Firefox’s E4X implementation can parse it, you could do something like this:

function displayData(rss) {
for each (var entry in rss..item) {
displayMessage(entry.summary, entry.author.name + ‘ says “‘ + entry.title + ‘”‘);
}
}

function loadcontent() {
var url = new XMLHttpRequest();
url.open(“GET”, “http://blah.com/somefeed.xml”, true);

url.onreadystatechange = function(e) {
if (url.readyState == 4) {
displayData(XML(url.responseText));
}
}

url.send(null);
}


Steve Yegge has an interesting post on extension systems that’s worth the (long) read, and he mentions Firefox’s explicitly (he’s, uh, not full of praise either).

http://steve-yegge.blogspot.com/2007/01/pinocchio-problem.html

I think we don’t see just how bad Firefox’s is since it’s still the best browser extension mechanism out there. That leaves us open to someone else doing it much better though, and if our extension system is a large part of what has made Firefox popular, that’s a worry. We don’t really want to be leapfrogged in this regard by IE.

Of course, as Steve mentions, writing a really good extension mechanism is also really, really hard.



Aza Raskin

@Ryan: I had no idea that EX4 existed. Thanks for the pointer.

@Byron: That’s a great question, and I’m not really sure of the answer. In Labs, we’ve decided that pragmatism should win out—so if including jQuery makes life easier, we’ll just do it.

@Jonathan: That’s exactly right. Once you’ve invested the significant amount of time to learn how to write extensions, you can no longer see the forest through the trees. I think a low tolerance for pain is critical when designing systems for other people. Also, thanks for the link. It’s epic!


It’s almost that simple if you use Greasemonkey. You won’t get a real extension that can utilize all of Firefox’s power but you will be able to do easy small customizations that’s if I remember correctly unfortunately are limited to the loading of individual pages and therefor can’t do any global customizations.

In some situations it can’t be used for easy extension of Firefox though and it shows how Fiefox’s real extensions could be improved.

Some Greasemonkey-scripts has also been reworked into real extensions making Greasemonkey a fast and easy testing ground for extension concepts.



skierpage

Thanks rpgfan, -no-remote -P works well and seems to start up very quickly when your main “firefox.exe” is running. I added a menu shortcut for it named “Minefield 2nd profile (-no-remote + profile)”

The trick should be promoted more, both for development and for reproducing bugs in a clean profile.



Aza

@skierpage: You should think about turning that into an extension itself ;)

@Pelle: Yep. Greasemonkey is a good first step. Too bad it is limited to acting only on page loads.


We definitely have a *lot* of boilerplate involved in writing extensions. Reducing the need for some of that would be great for the future. I think the main reason that it’s hard to simplify extension development is that extensions are essentially treated as additional chrome, handled just like the rest of the browser’s UI. While this gives you a lot of power, it also makes it very hard to do things like install without restarting, as there’s no real separation of the extension and application code in the internal representation. It might make sense to develop a more structured interface between extensions and the application, so we could do things in a more controlled manner. It’s sort of a trade-off, since the more defined you make the interface, the more restrictive it becomes.


Restarting an application during development is a common practice in many areas of software development (example: not all java application servers support hot deployment of code, and even the ones that do can be extremely flaky, resulting in frequent app server restarts).

That’s not to say restarts aren’t barbaric, but it is a common theme. It’s not a barrier-to-entry in terms of understanding and comprehension; it’s merely an inconvenience.

We should instead focus on simplifying other areas of extension development that result in less need for specialized domain knowledge (FUEL is a great start). Fixing development inconveniences like application restarts — which many software developers are already accustomed to because of other programming environments — will do nothing to reduce the current learning curve required to write one’s first extension.



Aza Raskin

@Eric: I’m not sure if that holds for web-developers. We aren’t used to long compile-time development practices. They aren’t just inconvenient—they fundamentally change the fast modify-reload dev cycle. That said, I think you are right about needing to also focus on other areas that result in less need for specialized domain knowledge.


This is not an outright solution, but in firefox one can set a couple of aprameters in the about:config page. When I do my extensions, it is only a matter of opening a new browser window and the changes to your extension sources kick in.

Also this relies on you having a link from .mozilla/firefox/extensions/plugins/ to the real source folder of your but its a one of thing for development.

Sorry I cannot recall the actual variables to be set, but these are documented in the firefox extension development documentation page.

Cheers
S


If FF did something like this, it would virally reinvent the web. Especially if that same power could work through prism on the desktop to trigger things not conventially thought of controllable via web scripting. I’m an old school Amiga guy, and I remember when just about anything could be scripted with AREXX.


It’s almost that simple if you use Greasemonkey. You won’t get a real extension that can utilize all of Firefox’s power but you will be able to do easy small customizations that’s if I remember correctly unfortunately are limited to the loading of individual pages and therefor can’t do any global customizations.


Is it possible to use the firefox -app trick to start a new XULRunner instance of Firefox (or a browser “lite”) while leaving your regular browser, and much of the shared library code, in memory? That would save some start-up time and loss of context. (I’d love to be able to do it to quickly test bugs against an empty profile.)



Sex

Is it possible to use the firefox -app trick to start a new XULRunner instance of Firefox (or a browser “lite”) while leaving your regular browser, and much of the shared library code, in memory? That would save some start-up time and loss of context. (I’d love to be able to do it to quickly test bugs against an empty profile.)


hemşo tanışıyormuyuz ses verin lan ak


    I aclautly wanted to jot down a brief comment to be able to appreciate you for those nice tactics you are showing on this site. My prolonged internet research has at the end been compensated with brilliant knowledge to share with my company. I would declare that many of us visitors aclautly are undoubtedly endowed to live in a notable website with very many marvellous people with helpful suggestions. I feel pretty blessed to have come across your website page and look forward to really more excellent moments reading here. Thank you again for a lot of things.


Developer extroadinare, Atul Varma, said it best: “I hereby classify restarting Firefox during development as a ‘barbaric measure’”. Of course, restarting Firefox to install extensions is like-wise barbaric.


Yep. Greasemonkey is a good first step. Too bad it is limited to acting only on page loads.


thnks
goooooooooooood
min:)


Hmmm interesting, especially liked the birthday cake analogy :D


that I have an account on twitter, that sending a file to twitter requires turning it into an URL,


Of course, restarting Firefox to install extensions is like-wise barbaric.



ptc

The blog was absolutely fantastic! Wide range of great information which may be useful some or maybe the other way. Keep updating your blog,


It will be great value to your readers because you make it easy for them


I love the layout of your blog! Totally creativ



craig

yeh, after many trying I still can’t a firefox extension up and running. Though I have two chrome extensions, each has above 40k users.


I’m going to take a note of your internet web site and also go ahead and take bottles furthermore?I’m glad to acquire numerous beneficial data the following in the publish, we wish create extra tactics on this regard, several thanks for discussing


Realy thanks intended for starting up this precise up.


Truly interesting report, thanks for submitting


Most from the people miss the initial crucial measures, similar to ensuring that you might have a good


Several thanks really considerably. It assisted! A minimum of we finally realized what was taking place!


thnks
goooooooooooood
min:)ااا


I like such topics


We’ve small idea what direction to go, yet this really is extremely beneficial


It?ersus lovely worthy of ample for me personally. Personally, in case all webmasters and blog writers created very good content material material as you did,


article on this site very useful. thanks – Sedang mencari rumah minimalis ? baca artikel tentang Info rumah minimalis secara gratis


Finally, I’ve found what I’m searching in your post. I liked this so much..


Simply have to condition your personal article is usually as incredible. The particular lucidity within your setup is just great along with i am going to presume you might be informed with this particular subject.


Wonderful post! I’m just beginning out in local community management/marketing media and attempting to learn how to do it effectively – resources like this guide are amazingly handy. As our firm is based mostly in the US, it’s all a bit new to us. The illustration previously mentioned is something that I be concerned about as effectively, how to show your very own genuine enthusiasm and share the fact that your item is useful in that circumstance


Finally, an issue that I want. I have searched for information of this caliber for the last several hours. Your site is greatly appreciated.


Great stuff from you, man. Ive read your stuff before and youre too magnificent. I love what you ve got here, love what you say and how you say it. You make it entertaining and you still can stay smart. I can not wait to read more from you. This is really a great blog.


Simple, wonderful what you ve done here. It is pleasing to look you express from the center and your clarity on this significant content can be easily viewed. Extraordinary items and expect your future updates.


I can see that you put a lot of effort into your blog. Keep posting the good work. Some really helpful information in there. Bookmark. Nice to see your site. Thank you!


Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that the most useful.


I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that the most useful


Great post! I m just starting out in the media community management marketing and trying to learn how to do it well resources like this article useful. As our company is based in the U. S. , it? S all a bit new to us. The example above is something that I worry about as well, how to show your own enthusiasm and share the fact that your product is useful in this regard


Hrmm that s weird, my comment got eaten. Still I would say that it is great to know that someone else also mentioned this as I have trouble finding the same information elsewhere. This was the first place that told me the answer. Thank you.


Hey, just looking around some blogs, seems a pretty good platform you are using. I m currently using WordPress for some of my sites but looking to change one of them to a platform similar to yours as a trial. Anything in particular you would recommend about it?


You can not intended to do so, but I think you have managed to express the state of mind that a lot of people entering Taste want to help, but not knowing how or where, is something a lot us are going through.


You got a really useful blog I have here reading for about an hour. I am a newbie and your success is very much an inspiration for me.


This article gives the light in which we can observe the reality. This is very nice one and gives in depth information. Thank you for this beautiful article


Keep em coming . you all do a great job at such concepts . can not tell you how much I, for one appreciate all you do!


Hi webmaster, commentators and more! Blog is absolutely fantastic! Lots of great information and inspiration, both of which we all need! B Keep em coming . you all do a great job at such concepts . can not tell you how much I, for one appreciate all you do!


Have you ever considered adding videos to your blog posts to keep the more entertained the audience? I mean, I just read your entire article and it was quite good but since I m more of a visual learner, I found that to be more useful well let me know how it turns out! I love what you guys are always up too. The clever work and reporting! Keep up the great work man I added you guys to my blogroll. This is a great article thanks for sharing this informative information . . I will regularly visit your blog for some latest post.


Pretty good post. I just stumbled upon your blog and wanted to say that I ve really enjoyed reading your blog posts. Any way I will be subscribing to your feed and I hope you post again soon.


That fantabulous post this has been. Somehow seeing this kind associated with useful post. I am grateful to you and expect much more associated with posts such as. Much obliged.


Thank you so much for writing all of the excellent information! Looking forward to checking out more posts!


Wow, this is a post that is really good quality. In my theory, AOD want to write like this also, AI took the time and effort to make a real good post. but what can I say. I procrastinate a lot and never appear to get something done.


I admit, I ve never been to the webpage in a long time. however it was another pleasure to see that this is an important topic and ignored by so many, even professionals. I thank you for helping to make it aware of possible issueExcellent things as typical people.


This post is quite interesting. I really never thought I could have a good read by this time until I found this site. I thank you for writing given. your information is also very nice. Thank you for the great post. From tons of comments on your articles, I guess I m not the only one having all the enjoyment here! continues to work well.


Interesting topic for a blog. I searched the Internet for fun and came on your website. Unusual items. Thanks a ton for sharing your knowledge! It is very nice to see that some people still put effort into managing their websites. I am sure


Just what I needed. Thankyou I ve been looking for this sort of information for ever. I made a note of your blog so I can read more on the subject.


I am really satisfied with this posting that you have given us. It is truly an amazing feat made you. Thank you and looking for more posts


I love your blog, i have it in my rss reader and always like new things coming out of this


I must tell you I was impressed. Very rarely do I find a blog, both educational and entertaining AOS. Just wanted to let you know that you have most definatly hit the nail on the head. Your mind is a good one. Thx is all I can say.


Most powerful, I just given this to a colleague who was doing a little study on this. And he actually bought me breakfast as a result of I found it for him . . smile. So let me reword that: Thnx for the deal with! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love learning more about this topic. If achievable, as you turn into expertise, would you mind taking updating your weblog with more information? This, AOS is very useful for me. Big thumbs up for this blog put up!


In fact, I learned about all of this, but with that in mind, I still think it is useful. Good work!


With the whole thing that seems to thrive in the subjects, all your perspectives are usually quite refreshing. Even so, I apologize, but I can not subscribe to the whole plan, all be it exhilarating nonetheless. It seems everyone that your opinions are not entirely justified and, in fact, usually do not really trust fully the argument. Anyway thank examined.


I see you put a lot of work on this site! Keep writing!


An interesting dialogue is worth comment. I think you should write extra on this matter, won, Aot be a taboo subject but generally people are not enough to talk about this issue. To the next. Applause


I was impressed with the quality of information on this site. There are many great resources here. I am sure I will visit this place soon.


It is a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a quality resource for free. I really loved reading your post. Thank you!


Super blog post, I count on updates by you.


I was very encouraged to find this site. I want to thank you for this special read. I definitely enjoyed every bit of it and I ve marked you to check out new stuff you write.


I admire the valuable information you offer in your articles. I will mark your blog and my children check here often. I am sure they will learn lots of new things here than anyone else!


Finally, a topic that fascinates me. That I am looking for information of this caliber for several hours. Your site is greatly appreciated.


Thank you for another essential article. Where else can you get this kind of information in such a complete way to write? I have a presentation next week, and I am in search of such information.


This is the perfect blog for anyone who wants to know about this topic. You know so much it s almost difficult to argue with you (not that I really want . haha). You definitely put a new spin on a topic that has been written over the years. Great stuff, just great!


This is a smart blog. I m serious. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. You have a design here that is not too flashy, but makes up for what you say statement. Great job, in fact.


What you say is absolutely true. I know that everybody must say the same thing, but I think you put it in a way that everyone can understand. I also love the images you put in here. They are very fit with what you say. I m sure you ll reach so many people with what you say.


Simple, beautiful what you have done here. It is pleasing to look you express from the center and your clarity on this important content can be easily searched. As incredible and welcome your future updates.


Let me start by saying wonderful message. Not sure if this has been discussed about, but when using Chrome I can never get the entire site to load without refreshing many times. Could be my computer. Thank you.


I can see that you put a lot of effort into your blog. Keep posting the good work. Some really helpful information in there. Bookmark. Nice to see your site. Thank you!


Far, this post is really sweet about this important topiac. I am in harmony with the conclusions and are greedily looking forward to the update entry. Saying thank you will not just be sufficient, for the wonderful clarity in your writing. I will immediately grab your rss feed to stay informed of any updates. Wonderful work and much success in your business dealings! Please excuse my poor English as it is not my first language.


Have you ever considered about including a little bit more than just your articles?
I mean, what you say is valuable and everything.
But just imagine if you added some great visuals or video clips to give your posts more, “pop”!

Your content is excellent but with pics and video clips, this blog could definitely be one of the greatest in its
niche. Very good blog!


Aw, this was a post that was really good. In theory I da like to write like this too taking time and real effort to make a good article . but what can I say . I procrastinate a lot and never seem to get something done that.


Simple, wonderful what you ve done here. It is pleasinag to look you express from the center and your clarity on this significant content can be easily viewed. Extraordinary items and expect your future updates.


“%KW%”


“%KW%”


This is a smart blog. I really do. You have so mucha knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. You have a design here that is not too flashy, but makes a statement as big as what you say. Great job, in fact.


This is the perfect blog for anyone who wants to kanow about this topic. You know so much it s almost hard to argue with you (not that I really want . HaHa). You definitely put a new spin on a topic that has been written about for years. Great stuff, just great!


The beauty of these blogging engines and CMS plataforms is the lack of limitations and ease of manipulation that allows developers to implement rich content and skin the site in such a way that with very little effort never see why the site tick all without limiting content and effectiveness.



Oren

Try writing a chrome extension.

The experience will resemble your piece of code.


Write Firefox Extensions is not easy for me, yesterday and tomorrow. I must brainwash myself very hard.


But with time, you may learn the way for making an enormous earnings from
more than half a dozen billion customers of mobile phone cellular
devices spread out throughout the globe.
Keyword Research – focus on 2-3 main keywords that are 100% related to what you want to advertise.
You don’t require making complete sale through the ad itself.


This article offers clear idea in support of the new visitors
of blogging, that truly how to do blogging.


Pretty! This was a really wonderful article. Thanks for providing this info.


This piece of writing will assist the internet visitors for building up new webpage or even a blog from start to end.


Hello. remarkable job. I did not expect this. This is a impressive story. Thanks!


Hi, can any body assistance me how to obtain this movie tutorial from this network sheet I have watched and hear it by this period but appetite apt down load it.


I truly appreciate this post. I have been looking bdisus all over for this! Thank goodness I found it on Bing. You’ve made my day! Thanks again


Pair reportedly lived together for years and had a volatile relationship. A man used an ax and carpet cutter knife to kill his 61 year old mother after an argument last week in the adult community where they lived, according to court records released Wednesday.


Hi, i believe that i saw you visited my website thus i return the desire?I’m attempting to in finding issues to improve my website!I assume its good enough to use some of your ideas!!


Hello.This post was really interesting, especially
because I was browsing for thoughts on this matter last Wednesday.


Developer extroadinare, Atul Varma, said it best: “I hereby classify restarting Firefox during development as a ‘barbaric measure’”. Of course, restarting Firefox to install extensions is like-wise barbaric.


Leave a Comment