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 <richlistbox id="context-commands"> 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.

2 Comments

  1. Mark Finkle’s Weblog » Firefox Mobile 1.1 Beta 1 and Add-ons said,

    April 27, 2010 @ 2:51 pm

    […] 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 […]

  2. Mark Finkle’s Weblog » Firefox 1.1 Beta 1 for Maemo said,

    April 29, 2010 @ 3:25 pm

    […] Context Menu with Open Link in New Tab and Save Image […]

RSS feed for comments on this post