Paul O’Shannessy

blah. blah. blah.

2 Years at Mozilla

On February 23rd, 2009 I started full-time at Mozilla. So much has happened since then, yet it still feels like it was just a couple months ago.

In addition to my time as an intern, I feel like I’ve seen a lot at Mozilla. With Firefox 4 I’ll be seeing my 4th release; 3.0 came out very shortly into my internship, followed by 3.5 soon after I started. 3.6 was my first version where I was around for the whole release, and 4 is so close I can taste it. I’ve had 4 bosses (Connor, Beltzner, Dietrich, and Dolske). We’re now on our 2nd CEO; I’ve seen 1 VP Engineering leave. I’ve met awesome people, and attended 2 summits.

I’ve worked on the password manager, satchel, session restore, the Jetpack prototype, the Add-on SDK, per tab network prioritization, and a whole bunch of random front-end stuff. I ported the Sync extension into Firefox and helped make Firefox work on Windows CE. I’ve even written docshell & widget code (even if it didn’t all get checked in)! The fact that I’ve gotten to work on such varying parts of Firefox is one of my favorite things about my job.

A lot has happened in my personal life as well. I lived by myself for the first time while Amanda was back at school (actually by myself, not counting dorm life or sharing a house). I’ve cleaned up more cat puke than I ever thought I would. I’ve made new friends and grown apart from older friends. I got engaged! I helped my fiancée start a company.

I guess it’s actually been a pretty long 2 years.

Updated Firefox Extension: Always Ask 2.0pre

Around the endgame for Firefox 3.6, I wrote an extension called Always Ask to make sure I always got a prompt when quitting. I used it for a while and then forgot about it when it was no longer compatible as Firefox 3.7 (now 4) moved forward.

Now that we’re at the endgame for Firefox 4, and especially with all the changes surrounding the quit dialog, I figured it should be updated. So I’m releasing v2.0pre today which updates the extension to work with component registration changes and quit dialog changes in Firefox 4. This also includes the translations that were submitted via Babelzilla (most of them over a year ago). Thanks to all of you who took the time to translate those strings.

Get it now. Or look at the code.

Why 2.0 “pre”?

Mostly just in case there are any further changes needed to be compatible with Firefox 4 (there better not be though).

Why not restartless?

This would probably work really well as a restartless extension. But I was really lazy and didn’t feel like figuring out the l10n part of that (though it looks like Erik Vold has that figured out already).

New Firefox Extension: switch-to-tab Blacklist

Switch To Tab is a pretty cool feature that will be a part of Firefox 4. I didn’t work much on it, but I contributed a bit to it last year (see this post for one example).

For the most part, I really like this new feature. It’s saved me much tab duplication over the past several month. However there are some sites that it doesn’t play well with, namely some JavaScript “applications” and pages with frames. I’ve quietly dealt with it and worked around the issues.

But a couple weeks ago after trying to do multiple Google Maps search, I decided that I’d had enough. I never wanted Google Maps to show up in switch to tab and I was going to write an add-on to make that possible. So I spent a bit of time figuring out how I might do that and looking at this new bootstrapped extension stuff (which is pretty awesome by the way). I didn’t get far enough to make it actually work and stalled. Then I got back to work and fixed some more blockers and promptly forgot about this idea.

Yesterday I started working on it again but my current approach wasn’t working (turns out gBrowser._placesAutocomplete is readonly and it means it). So I asked Shawn about it and he came up with the answer: cheat. Don’t try to intercept the additions to the database, just revert them after the fact. Smart guy.

I wrote a quick and dirty version and iterated. I released a “good enough” version 1.0 last night. “Good enough” meant it was restartless but required restarting to re-process the blacklist preference, which was… dumb. Over lunch today I finished v1.1 to fix that and a couple other small issues.

Let me have it

switch-to-tab Blacklist on AMO

Can I see the code?

It’s on github. I need to clean it up because it’s a bit hard to look at, so don’t judge me too much.

This picture is not worth 1000 words

Previously, that autocomplete result would have been said “Switch to tab:”.

Customizing the blacklist

I’m storing a JSON array of regular expressions (stored as strings which get turned into regular expressions with new RegExp(...)). This is stored in a preference: extension.switchToTabBlacklist.blacklist. You need to edit it by hand for now.

Where’s my GUI

I don’t have visual basic on this computer so I couldn’t make one.

To be honest, I just didn’t care enough to make it. I made this extension for me and I know how to edit a preference. I would gladly take patches though if somebody wants to make one.

About That Quit Dialog…

Remember when we turned it off a couple weeks ago? We did that by just flipping the browser.warnOnQuit preference to false. I mentioned that you could get old behavior back by flipping that preference back to true. That’s not going to work anymore.

I just landed bug 629485 to change things again, so pay attention. When we turned off the quit dialog, we took away any way of stopping the last window from closing without any warning, even if you explicitly set the visible pref browser.tabs.warnOnClose which would show the window closing warning (when you have multiple tabs). That wasn’t so cool. So we played around with the logic and made that possible. But in order to do so, we had to change the default value of browser.warnOnQuit to true and create a new preference which controls the quit dialog (browser.showQuitDialog). I know this sounds a bit inane, but there really wasn’t a better way to do it and maintain browser.warnOnQuit == false as an override.

It’s all a bit confusing, so I’ve documented the conditions under which we won’t show a dialog, as well as the rules for choosing which dialog to show. Some of that comment is perfectly clear; the rest requires a little bit of understanding of the code (but it shouldn’t be too hard to figure out if you want).

Don’t expect me to write another post like this. I don’t expect any further changes to how this stuff works.

TL;DR

  • We enabled the window closing dialog when closing the last window would otherwise just quit (mostly important to Windows and Linux users).
  • If you want the quit dialog back, set browser.showQuitWarning to true and make sure browser.warnOnQuit is also true.

Update: Feb. 8, 2011: Yup. I fucked that up a little bit. We aren’t showing the quit dialog if you close the last window, even with the prefs mentioned above. That should be fixed in the next nightly.

The new Firefox default home page is seriously sexy. Seriously.

A couple weeks ago Stephen Horlander designed an updated default home page for Firefox. Over the weekend, we landed most of it. So first off, a huge thanks to him.

Mihai Sucan did an awesome job converting the HTML & CSS Steven prototyped into something we could check in, which involved a lot of fun with media queries  (seriously, resize your window with it open), as well as a lot of work to make sure it worked with RTL locales.

And then finally, I hooked up the “Restore Previous Session” button. Not the HTML & CSS (that was Stephen & Mihai), just the parts that made it hide when appropriate and work when pressed. Now hopefully a few people realize that feature exists :)

I also can’t forget to mention Marco Bonardo, who hooked up about:home back in August so that we could even get to this point.

Keep in mind, the image I’m showing here is the unbranded “Minefield” version of the page. When loading this in Firefox it won’t look like your computer is going to explode. I think there is a little bit more tweaking that will be done, but it already looks so much better than it used to.

The new Firefox default home page is seriously sexy. Seriously.

A couple weeks ago Stephen Horlander designed an updated default home page for Firefox. Over the weekend, we landed most of it. So first off, a huge thanks to him.

Mihai Sucan did an awesome job converting the HTML & CSS Steven prototyped into something we could check in, which involved a lot of fun with media queries (seriously, resize your window with it open), as well as a lot of work to make sure it worked with RTL locales.

And then finally, I hooked up the “Restore Previous Session” button. Not the HTML & CSS (that was Stephen & Mihai), just the parts that made it hide when appropriate and work when pressed. Now hopefully a few people realize that feature exists :)

I also can’t forget to mention Marco Bonardo, who hooked up about:home back in August so that we could even get to this point.

Keep in mind, the image I’m showing here is the unbranded “Minefield” version of the page. When loading this in Firefox it won’t look like your computer is going to explode. I think there is a little bit more tweaking that will be done, but it already looks so much better than it used to.

The California DMV has Terrible Browser Recommendations

It appears as though the California DMV has not updated their website in the past 10 years…

To be able to use this online application, your computer will need to have one of the latest versions of either the Internet Explorer, Netscape Communicator/Navigator, or equivalent web browsers. For Internet Explorer you must have version 4.0 or higher. We suggest you use Netscape Communicator/Navigator version 6.0 or higher to eliminate any possible printer problems.

California DMV Browser Requirements

Internet Explorer 4 came out in 1997. Netscape 6 came out in 2000. How far we’ve come…

In related news, the next available appointment (to take the “written” test) at the DMV in San Francisco is halfway through March. I bet I could get a new passport sooner.

Just Quit It

For a long time now, if you didn’t have Firefox set to restore your session then Firefox would prompt you before quitting. A dialog with 3 buttons and a checkbox. It looked like this:

That mostly just gets in your way though. You’ve already decided you want to quit. You don’t also need to decide if you want to reopen your tabs next time. So starting with the next nightly (January 21st) and Firefox 4 beta 10, you will no longer see that prompt. Of course if you already checked the box to “not ask next time” you weren’t seeing this anyway.

Essentially, all we did was flip a preference that has been there since Firefox 3 (that was almost 3 years ago for those of you keeping track at home). browser.warnOnQuit was added as hidden preference to override other conditions that might cause a dialog shown at quit. We set that to false. If you want Firefox 3.* behavior, then just flip the pref back to true.

If you’re interested, this was done in bug 592822 (it was originally planned as part of bug 588482).

Dude, Where’s My Session?

I know it’s been a while since I wrote about it, but it’s now possible to restore your session on demand after startup. There is work underway to make that feature more visible, namely bug 593421 (to add a button on the start page) and bug 589665 (to add a button in Panorama).


Update (Feb. 7, 2011): We had to make some further changes. We kept the dialog turned off by default but had to do some work with preferences. Setting browser.warnOnQuit is no longer good enough to show the quit dialog. Read more

Pagination: Next, Next, Previous

Nobody has said anything but I haven’t had pagination enabled on this blog since it started. It was initially cut from the theme since I didn’t like what I’d done and I didn’t have to worry about it.

This summer I realized I had more than 1 page of content but didn’t care enough.

Tonight I just took out the comments that had been hiding the content. Turns out what I had designed is good enough to get the point across.

Through the Spam Filter

Hi dear, you are very nice I wish i could get to know you for it is my pleasure to have you as my friend for a friend is all about Respect„,Admiration,contentious and affectionante also friendship is consist of sharing of ideas and showing true affection without cheats„,lies and betray so can you welcome me, lets get to the ocean of love ?????????????
I am miss lucy by name

Certainly not the most interesting piece of email to ever make it through the spam filter, but seriously, LET’S GET TO THE OCEAN OF LOVE ?????????????

Apparently Amazon is stepping right into HTML5 and using type="email" in their sign in form. You can see the built-in form validation in action there. This is pretty awesome to actually see out in the wild, especially from such a big name.

Client-side form validation without various JS libraries is pretty cool. Read more about it.

Apparently Amazon is stepping right into HTML5 and using type="email" in their sign in form. You can see the built-in form validation in action there. This is pretty awesome to actually see out in the wild, especially from such a big name.

Client-side form validation without various JS libraries is pretty cool. Read more about it.

Reset Panorama from the Error Console.

Panorama is this cool new feature coming to Firefox 4. Most of the big issues have been fixed, but there’s still the occasional issue with orphan tabs.

Last week I wrote a script that would strip the Panorama data out of Session Restore. That worked but would require a restart. Ian Gilman (one of the Panorama developers) used that script for the basis of a script that worked much better (it actually called into Panorama and told it to reset properly). The only problem is that it left tabs hidden, so it would require jumping into and then out of TabView to bring everything back to normal. I forked that and just added a call that made sure all tabs were shown.

So if you ever get into a confusing state and don’t mind wiping out your current Panorama data, this script is for you: