25 January 2011 - 0:39Restartless add-on example code

mfinkle’s recent posts [starkravingfinkle.org] on restartless add-ons reminded me that I was going to write a more detailed post about my restartless GitHub repository, but I’ve been distracted with another project. ;)

So briefly, I’ve put together some helper functions [github.com] that have been useful for developing various restartless add-ons. I’ve organized the repository to have a bunch of “examples/” branches that build on top of other named branches that implement helper functions.

These first few are very simple examples:

examples/autoReload: saves a step when developing a restartless addon by automatically re-enabling when you disable the add-on from about:addons

examples/ensureEnabled: the install method always gets executed even when disabled, so this code makes sure the add-on runs on install; useful when combined with the following..

examples/oneTime: run once and disable itself; useful for debugging problems on other people’s Firefox without doing the usual “copy/paste this into the Error Console”

The next couple helper functions have been incredibly useful for the restartless add-ons I’ve written:

unload: add a callback to run when the add-on is disabled by calling unload(callback). This function makes it easy to ensure Firefox returns to its original state when a restartless add-on is disabled (which is very important for developing as you’re likely to disable and re-enable many times!) (example)

watchWindows: add a callback to run when the main Firefox browser window is open (navigator:browser) by calling watchWindows(callback). The callback will be called immediately for existing windows and future windows, so put whatever browser UI modification code you want inside the callback. (example)

One last helper in the repository is the getString function that adds some l10n support to get the correct .properties file for the current locale. It shows off getting additionally packaged files and picking the right locale and some plural forms. I’ve put together a silly example at examples/l10nDialogs.

Silly l10n example

With all these helper functions, Erik Vold and Nils Maier helped put together some code that loads packaged scripts. We ended up with some code that makes use of getResourceURI so that it correctly works if the addon is .xpi packaged or an extension proxy file. Separating out the code this way lets you better organize the code and makes it easier to share.

3 Comments | Tags: Add-on, Development, Mozilla

22 January 2011 - 13:33Looking for some prototype testers

Edit: The add-on has now been released, so check out the announcement post: Towards Browse-Based Browsing with Home Dash. Thanks for the feedback!

I started hacking on an idea last week in the context of the Prospector experiments [mozillalabs.com]. I’m looking for a small set of people to try it out and give some initial technical feedback. For example, I know I’ve hard-coded some sizes/images that happen to fit my 1280×800 screen on my Mac, but I am curious how it works or doesn’t work on other platforms, window sizes, etc.

You can install the restartless add-on [edit: addons.mozilla.org] if you’re already running Firefox 4 Beta 10 [firefox.com] or later. I’m not really describing it on purpose. ;) But not to be too confused, below is a sketch from when I started hacking on it. And as usual, you can check out the source first from GitHub [github.com] or directly from the .xpi.

Sketch of Home Dash

You can email me the feedback at edilee@gmail.com or just reply with a comment!

23 Comments | Tags: Development, Mozilla, Search

21 December 2010 - 11:20#status 2010-12-20

- Brainstorm next Prospector experiments

At the Mozilla All Hands last week, and we held a discussion to brainstorm various ideas to try out in the Prospector family of experiments. A couple of the current experiments like Speak Words and Instant Preview help users get back to top sites almost instantly with just one key stroke, but these mainly help for the relatively small set of sites that users frequent and not so much the remainder of the history available in Firefox.

So the next set of experiments will focus on improving the experience of searching for pages in Firefox. Interesting findings from Query Stats could help identify relevant pages or help build a better view of your past browsing behavior. Additional data about each page could be tracked by Firefox such as unique phrases from the page or how long a tab was opened and interacted with.

Displaying the search results also received some attention as to how to add all this extra information in a clean way. Some ideas ranged from being more space efficient by showing location bar results on one line to taking up more vertical space as one might not need to use the page when searching. This led to ideas of using the whole tab content area to show rich results and provide interaction such as grouping/switching of types of results like pages, apps, videos, etc.

- Prepare search bar -> button demo

Along the lines of combining the location bar and the search bar, I’ve been hacking together a Prospector experiment that changes the search bar into a list of buttons. This allows for explicit control for the user to decide when searching should be local to Firefox’s history or over the web. It also makes it apparent that there are multiple search engines to choose from and clicking another button switches the current search request to another provider.

When clicking a button, it inserts a keyword and focuses the location bar, so it’s like doing a smart bookmark keyword search with the first location bar suggestion being the search. Combined with Instant Preview, it’ll automatically update the results immediately as you type more words or switch engines.

- Attend Open Web App discussions

I was curious what kind of web-apps were being created in general across the various web-app stores available today because I wanted to see if the search bar -> button experiment above could add to the types of available apps. This is because generally speaking, these search buttons processes some words from the user and converts it to a url or a set of results.

From the screenshot above, the last button is actually for Google Translate, so when I click the button and type “hola mis amigos”, Google translates it immediately as I type to “hello my friends“. This somewhat feels Ubiquity-like, which had all sorts of commands, so potentially allowing the web app manifest to describe these “searches” or “actions” could lead to web-apps that are more than just bookmarks.

- Push restartless code examples to GitHub

I’ve been hacking on restartless add-ons for a while now and noticed that I copy/paste some useful helper functions for when I start a new add-on. Other people hacking on these bootstrapped add-ons could make use of them as well, so I created a “restartless” repository on GitHub. I’ll write a post going into more detail later, but briefly, it’s a collection of git branches where each branch contains a helper function or provides an example usage or pattern.

- Tracking down flash crashes

I’ve been running into Flash crashes on OS X for a while and noticed other people were in a similar situation. So to help resolve it, I started tracking down the various flash crash reports, and I’ve posted about my findings and issues that I ran into.

6 Comments | Tags: Add-on, Conference, Development, Labs, Mozilla, Search, Status

19 December 2010 - 11:33Tracking Down Flash Crashes

Over the last many months, flash has been crashing for me on any page with flash video when I browse away. This means flash crashes when clicking a link or typing in the location bar. Or probably worst when a site that has a flash intro it crashes when loading the main content of the site.

This seems to only affect the Flash Player 10 plugin on OS X, but it was still a bit tricky finding out what crash reports are related to this particular issue.

- There are many versions of the flash plugin

If a bug is reported with a crash signature like [@ FlashPlayer-10.6@0x4b4b39 ], watching the number of crashes for that signature go down may initially seem like something was fixed, but actually users are upgrading their version of flash and crashing at a different address. Additionally, it’s harder to see the actual number of crashes for this issue at a glance as the reports are spread across many entries.

- FlashPlayer-10.6 plugin version is missing

Adding to the issue of there being many versions, for some reason the version information for FlashPlayer-10.6 shows up in reports as 0.0.0.0. Fortunately there’s an additional debug identifier that is consistently reported for the same version of the plugin.

Below is a listing of some recent versions and debug ids:

10.2.151.49nov 303CDC6F1339C791580EC31A451724F0110
10.1.102.64nov 47F846A865E18B6E54DA2E5B46E7CF5B20
10.1.85.3sep 20392E898E2D7BCE8B02FFCE2287F7DF570
10.1.82.76aug 105295F1D9A734E9FDD5350646BF2615A40
10.1.53.64jun 1028AEE5D0CE3E55DB5AE5787143EC0F960

I gathered these by looking through Adobe’s security bulletins to find the date and version of the new release. With the release date, I could then search for crash reports from before the release and see which reports disappeared. Then from the reports that did disappear, I can record the debug identifier to be for the new version.

- Crash reports not being submitted

Another issue that has recently been fixed was that most people running into these plugin crashes had no option to send a crash report. This was because Firefox by default runs in 64-bit mode and was unable to create a report for 32-bit plugin crashes. This means the frequency of the crashes were massively under-reported and the sparse crash data made it harder to find relevant reports.

- Improving crash-stats triaging

For this particular case, I can think of a couple features that could have made tracking down flash crashes more efficient.

Because the crash signature kept changing from version to version, I had to inspect many crashes to see if the whole stack is similar to other stacks. For one set of crashes, I was looking for AnswerNPP_Destroy in frame #8 to identify the family of crashes. Being able to search in part of the stack could also make it easier for various component teams find relevant reports.

For another set of crashes, the crash reason was always EXC_BAD_ACCESS at address 0x44c. So in addition to being able to filter by crash signature, being able to search by reason and address could have avoided needing to click through many crash signature reports.

There’s a number of bugs filed for these flash crashes like bug 590955, bug 572134, and bug 617469. I’m still not sure if it’s an issue with OOPP or a bug in the plugin, so it’s hard to say if flash will stop crashing by a new Firefox beta release or a plugin update. But just as a heads up, getting the latest Flash Player 10.2(.151.49) beta or Firefox 4 beta8 won’t fix these crashes.

12 Comments | Tags: Development, Mozilla