Crash Reporting Comes to Firefox Mobile

The latest Firefox Mobile nightly builds have enabled the Mozilla Crash Reporter, powered by the same Breakpad system as desktop Firefox. While desktop Firefox has been using Breakpad since Firefox 3.0, it was only recently ported to the ARM architecture of the Nokia N900.

Now, when Firefox Mobile (or Fennec nightlies) crash, you should see this application appear:

If you decide to send a crash report to Mozilla, and we really hope you do, you can see your crash, and other crashes, at the Mozilla Crash Reports web site. Here’s a list of all the Firefox Mobile crashes. For example:

You can also manage crash reports from Firefox Mobile itself. Use about:crashes to view all the crash reports created on your device:

Crash reporting and the data they provide will be a huge help to the mobile team. A big thank you goes out to everyone who helped get crash reporting enabled on Maemo!

Smart Tapping in Mobile Firefox

It’s now well understood that, when designing for a touchscreen, there are certain minimum usable sizes for touchable targets. While the amount you can display on a screen is increasing with higher resolutions, human finger sizes aren’t changing, and fingertips are much larger than a mouse pointer. As a result, most UI recommendations for touch-target sizes on mobile devices range from around 7mm to 9mm.

It’s relatively easy to take these minimum sizes into account when designing your own interface. But what about when you’re displaying something that someone else has designed, and that wasn’t built with fingers in mind? This is the situation mobile browsers encounter in most web pages: links, fields, and buttons are often much smaller than you’d want them to be in order to tap on them, but making them bigger would interfere with the designer’s intended layout.

An approach that a number of touch-oriented OSes take is to make a small target’s tap-sensitive area larger, invisibly, than the visible target itself. This approach has been cleverly referred to as using “iceberg buttons” because the visible part of the target is much smaller than what’s lurking below. In fact, the iPhone does this with their keyboard as well, dynamically changing the invisible button target size based on what letters it predicts are most likely to come next.

Given how central link-tapping is to a browser, and how frustrating it is to tap the wrong link or not be able to tap at all, we decided to build our own approach.

Introducing SmartTap

In Firefox Mobile 1.1, we’ve added a smart-tapping scheme with the goal of allowing for accurate and easy tapping on links, form widgets and other focusable targets in web content. The main concepts of the approach are:

  • Using a region, not just a point, to define the tap location
  • Creating a list of focusable element candidates in the region of the tap
  • Weight the elements by z-order
  • Weight the elements by distance from the actual touch point
  • Weight the links by number of visits

The result of the algorithm should be the element you were most likely trying to tap. Initial results show that tapping elements in Firefox Mobile 1.1 is much easy than previous versions. From a user’s perspective, taps just seem to work as they should.

Implementation Details

The code to support SmartTap was added to both the Mozilla platform and the Firefox front-end. It’s very flexible. The platform already exposes an elementFromPoint API to chrome and web content. The new API, nsIDOMWindowUtils.nodesFromRect, is very similar, but is only available to chrome content. For a given region, established by top/right/bottom/left, and a point, the method will return a list of possible DOM nodes.

The returned list is sorted in z-order. The Firefox front-end code then applies additional heuristics to the node list to find the most likely candidate. The code filters the nodes by “focusable” elements, weights by the distance of each node from touch point and, finally, weights visited links higher than other elements.

The region passed to nodesFromRect can be controlled via preferences (browser.ui.touch.top, browser.ui.touch.right, browser.ui.touch.bottom, browser.ui.touch.left). The weighting used for the visited links can also be adjusted using the browser.ui.touch.weight.visited preference.

Firefox Mobile uses a region that is offset more above the touch point. This has the affect of favoring elements above the touch point – which is based on our observations that people tend to “tap” below elements. Here’s a simple illustration:


click for larger image

The red dot is the actual touch point. The red box is the region passed to nodesFromRect. The title link will end up being “clicked” even though the author’s name text was actually “tapped.”

Another bit of intelligence in this system is based on the same insight that drives the Firefox awesomebar: that people tend to visit the same pages over and over again. Links are given higher weightings if they’ve been visited before, so visited links are more likely to “win” if a tap target is ambiguous because multiple small links are very close together. In practice, from the user’s perspective, tapping on the intended link just seems to work more often.

Thanks to Madhava Enros, Vivien Nicolas and Felipe Gomes for contributing to this post.

Firefox 1.1 Beta 1 for Maemo

Firefox 1.1 Beta 1 for Maemo is ready to install. For this release, the focus was some UI features we didn’t have time to put in the initial release. We are also using your feedback from previous releases and nightly builds to help improve the browsing experience.

Some of the bigger features include:

  • Form assistant improvements, including autocomplete
  • Start Page redesign
  • Auto update add-ons
  • Portrait support on N900
  • Context Menu with Open Link in New Tab and Save Image
  • Web content theme update
  • Manage site preferences (clearing passwords and others)
  • Improved Site Menu
  • Use volume keys to zoom on N900
  • Save page to PDF

As always, we’ve provided unbranded Fennec desktop builds on Windows, Mac, and Linux. You can use these if you don’t have a Maemo device or to aid in add-on development. Add-on developers should use this release to update add-ons from Firefox 1.0.x for Maemo.

Note to Ovi Store Customers: If you installed Firefox 1.0 from the Ovi Store, you will not be able to upgrade to Firefox 1.1 Beta 1 (either from the N900 Application Manager or by downloading the software from Mozilla). We are working to solve this for future releases so that anyone can participate in our Beta programs. Don’t worry, though, if you got Firefox 1.0 from either the Ovi store or directly from Mozilla, you will be updated to Firefox 1.1 (final) when it is released.

We want to get as much feedback as possible before moving to a final release candidate, so please leave comments or file bugs.

Firefox Mobile 1.1 Beta 1 and Add-ons

With Firefox 1.1 Beta 1 for Maemo ready to go and the final release not far away, now is an excellent time for add-on developers to update their add-ons. Obviously, Mozilla wants as many add-ons as possible to be compatible with the latest version of Firefox Mobile.

AMO (addons.mozilla.org) is ready for add-ons to set maxVersion to 1.1.*

Please test your add-on before bumping the version. You can use the nightly builds for Maemo, as well as the desktop versions to help test. Here are a few things to keep in mind while testing add-ons:

  • Site Menu: The site menu was redesigned and uses different XUL and JS. If your add-on adds a command to the site menu, please check out the changes and update your code.
  • Context Menu: Long taps (or right clicks on desktop) will display a context menu, but only limited targets are allowed (images, links and mailto: links). If your add-on can benefit form the context menu, use it. But use it wisely.
  • Startup: When starting the browser, the Awesomebar Screen is no longer shown. A true Start Page system is now used. Adjust your add-on startup process if needed.
  • Portrait Mode: Firefox for Maemo (and Android) now supports dynamic portrait/landscape orientation. Make sure your add-on works well in both orientations.
  • Theme Breakage: Check to make sure the add-on is not including the chrome://global/content/global.css stylesheet. It will break the mobile platform CSS. An easy way to see this breakage is to look at the toggle buttons in Preferences UI. If those buttons look like checkboxes, the CSS is broken. This seems to be very common for new add-ons.
  • Check for Errors: When testing the add-on, launch the browser from a terminal and use | fennec –jsconsole | to open the JS Error Console. Make sure no errors appear in the console while testing the add-on.

If you have any questions, please use Mozilla IRC and join the #mobile channel. Use mibbit if you don’t have an IRC client. I’ll be there (mfinkle), as will many other helpful people who can help answer your questions.

Fennec 1.1 Context Menus

Fennec 1.1 now supports context menus. Using a long tap (aka tap-n-hold), or right-click on desktop versions, you can get a context menu to appear.

We intentional designed the context menu system to be simple and minimalistic. We do not want large context menus with many, many commands. Currently, context menus are only displayed if the user long-taps on a link or an image. Technically, not all links will activate the context menu. javascript: links, for example will not activate the context menu.

Fennec 1.1 will only ship with two context menu commands: Open Link in New Tab and Save Image.

Add-ons can extend the context menu. Just overlay the context menu list of commands, which is in the XUL. Each command must have a type attribute and only 3 types are recognized: link, image, mailto.

The context menu system will automatically show/hide commands based on where the user long-taps. Under normal circumstances, the add-on will not need to worry about showing or hiding the context menu command:

  • If an image is tapped, only type="image" commands will be shown.
  • If the element is an image inside a link, both types of commands will be shown.
  • If no link or image is picked, no context menu will be shown at all.

Yes, this is a bit restrictive, but that’s the way we want context menus to work for now. Feedback is always appreciated and Mozilla IRC (#mobile channel) is available to help answer questions.

Firefox Mobile 1.1 – What’s Coming

The Mobile Team has been hard at work on the 1.1 release of Firefox Mobile. This release will mainly be a Nokia Maemo release, but the current Android builds are based on the same front-end.

For the 1.1 release, we are focusing on some UI features we didn’t have time to put in the initial release. We are also using your feedback to help improve the browsing experience. You can see the list of planned features on the planning page. As you can see, we have completed much of the work and the beta release is quickly approaching.

Some of the bigger features that have already landed include:

  • Form assistant improvements, including autocomplete
  • Start page redesign
  • Auto update add-ons
  • Portrait support on N900
  • Context Menu with Open in New Tab and Save Image
  • Web content theme update
  • Manage site preferences (clearing passwords and others)
  • Clean up site menu
  • Use volume keys to zoom on N900
  • Save page to PDF

Screen shots of the some new features:


Form Assistant with Autocomplete:


Start Page:


Context Menu:


Page Menu:

FOSDEM 2010 and Fennec Project Update

I was lucky enough to be able to attend FOSDEM 2010. It was my 3rd FOSDEM and I had a blast. I was able to catch a few good talks outside the Mozilla DevRoom, including one of the keynotes. Inside the Mozilla DevRoom, we had a lot of interesting talks from lots of different people and projects. Thanks to everyone who made FOSDEM such a great experience!

I was part of a talk on Firefox Mobile (Fennec). We had about 75 minutes for the talk, so I successfully recruited Vivien Nicolas and Fabrice Desré (two other mobile developers) to help with the presentation. We tried to cover many different topics during the presentation:

  • The thought process for porting to a platform
  • How porting affects the Mozilla platform
  • Designing a touch-friendly UI
  • How you can use add-ons to extend the mobile browsing experience
  • Tips and tricks for great mobile UIs and fast code
  • The roadmap for Firefox Mobile -> 1.1 and 2.0

I am planning a few more blog posts to discuss the Firefox Mobile roadmap soon.

Firefox for Mobile – Keyboard Shortcuts

Not every mobile device has a physical keyboard, but many do. Firefox Mobile supports a handful of keyboard shortcuts that might make your life a little easier:

  • Zoom in: Ctrl+Up arrow
  • Zoom out: Ctrl+Down arrow
  • Go to Location Bar: Ctrl+L
  • Back one page: Ctrl+Left arrow or Backspace
  • Forward one page: Ctrl+Right arrow or Shift+Backspace
  • New tab: Ctrl+T
  • Close tab: Ctrl+W
  • Open link in new tab: Ctrl+Tap on link

For a more complete list of keyboard shortcuts, and lots of other useful information, go to the Firefox Mobile support knowledge base.

Perils of the viewport meta tag

Apple introduced the viewport meta tag in mobile Safari to help web developers improve the presentation of there web pages on the iPhone. We added support for the viewport tag in mobile Firefox for the same reasons.

The viewport tag allows web developers to set the width, height and scale of the browser area used to display web content. However, some websites are not doing a good job configuring the viewport tag and it affects the presentation in Firefox.

When setting the width or height, developers can use a fixed number of pixels or use the constants: device-width and device-height. The iPhone is 320px wide in portrait and 480px wide in landscape. Other devices have different screen sizes. It seems the “width=320” is a popular fallback though. See how Facebook and DeviantART display in Firefox on the N900 (480px in portrait and 800px in landscape):

touch.facebook.com
fennec-viewport-facebook

deviantart.com
fennec-viewport-deviantart

Don’t get me wrong. I like “touch-friendly” web pages on my mobile device. However, the iPhone is not the only mobile device out there. If a web developer has gone through the effort to make a “touch-friendly” web page, please configure your viewport to work in other devices. It’s easy!

AdBlock Plus Adds Support for Fennec

Thanks to Fabrice Desré and Wladimir Palant, development builds of AdBlock Plus support Fennec! The port embraces Fennec’s minimalistic design asthetic – exposing only a simple options UI. However, this is more than enough to make a great impact on browsing in Fennec.

fennec-adblockplus-options-small

Besides reducing the visual clutter on web pages, ad-heavy pages load noticeably faster! As Wladimir notes in his post, AdBlock Plus will only work in nightly builds of Fennec (version 1.0b6pre). Install a nightly version (including desktop versions) or use the new nightly update channel from your Maemo device. He also mentions that work to improve the first-run experience is coming in future releases.

Install a development build of AdBlock Plus by navigating to https://adblockplus.org/devbuilds/adblockplus/ using Fennec and click on the most recent XPI file. Fennec will step you through installing the add-on.