Context Menus in Firefox 2

Context menu for a linked image with focus on View Image.

There are items for what was clicked, what is selected elsewhere and items for the page in general. Only show items for what was clicked on. That’s the context part of context menu.

When text is selected elsewhere, the context menu has 17 items and 4 separators. Wow!

Result

Image or Background Image

<img>, background-image and list-style-image could all be treated the same way. Only provide items for the image the user actually clicked on.

Result

Just apply the above principles.

Result

Selected Text

Remove Search default provider for “selected text”.... Search box is available in top-level chrome with support for drag-and-drop or copy-and-paste. This item also makes the context menu really wide.

Result

In Text Control

<textarea>, <input type="text">, scripted widgets and so on:

Result (Text Selected)

Result (No Text Selected)

General Items

Right-clicking the page when none of the above apply.

Result

Background Image

Process

  1. Start with items for this context as if it had no background image.
  2. If the group of image items is not shown, create an empty group in that position.
  3. Add View Background to the end of the group.