Document Complete
This document will no longer be updated. Please use bugzilla to track issues and progress for stories.
Contents |
Introduction
Contextual menus for webpages in Songbird is weak.
Purpose of This Document
This document contains an inventory of contextual menus that are seen in Firefox 3 beta 2 and Songbird 0.4 final.
This document also proposes a solution for 2244. The proposal is the outcome of starting with Firefox's contextual menus and aggressively removing items that are either advanced features or that are not related to media that Songbird understands then adding items that are specific to Songbird.
Goals
By user
- [Business] ?
- [User] Users who are used to interacting with webpages in conventional web browsers via the contextual menu will feel at home. Also, it's always good to have more than one way of accessing functionality.
- [Developer] Developers who want to port Firefox add-ons can do so with little effort because the contextual menus look similar to that of Firefox.
Specification
Description
Please see Firefox 3.0 Beta 2 for contextual menu behavior for items that are in black (because the menu items that are in black were ported from Firefox).
Top level story : 8388
| ID | Cost | Title | Story |
|---|---|---|---|
| 8390 | 3 | Port over Firefox contextual menus | Take the contextual menu and associated functionality from Firefox and integrate into Songbird while adding the ability to add/remove to it. (see notes) |
| 8391 | 2 | Open page in default web browser Open link in default web browser Open frame in default web browser Open image in default web browser | The target URL is opened in the OS-default web browser. Menu item should always be enabled. |
| 8392 | 1 | Subscribe to this page | The new subscription dialog should be displayed with the URL field populated with target. The menu items should be enabled only when the subscription button in the web bar is enabled. |
| 8393 | 1 | Open link as playlist | Treat the target URL as if it is a valid playlist. Menu item should always be enabled... because we are assuming that the user knows better than the system. Note: Usefulness is questionable but should keep it around till playlist detection is looked at again. |
| 8395 | 2 | Play Download Add to playlist | Menu items should behave the same way as if they were selected from the webpage playlist. Menu item is enabled only if Songbird detects that the link points to a media item (ie: when the URL in the status bar is bold). |
Engineering Notes
- We need to decide whether we want to simply include nsContextMenu.js from mozilla, or import it into our codebase and make modifications to it (as in, fork it). See the Additional Engineering Notes and Knwon Risks sections for more info on this. The cost of either choice is essentially the same.
Additional Engineering Notes
- Porting over the Firefox contextual menus implies the following tasks :
- Bring in popup menu elements from contentAreaContextMenu (http://lxr.mozilla.org/seamonkey/source/browser/base/content/browser.xul#174 , http://lxr.mozilla.org/seamonkey/source/browser/base/content/browser-context.inc) into our own contentAreaContextMenu (layoutWithBrowserOverlay.xul), and reorder/remove items according to specs.
- In order not to have to fork chrome://browser/content/nsContextMenu.js (http://lxr.mozilla.org/seamonkey/source/suite/common/nsContextMenu.js), we should name some of our separators differently than Firefox does, so that they are not automatically shown/hidden by the logic in nsContextMenu.js, which does not always match our needs since the order of some of the menuitems items is different in Songbird. Items that are non-existant in Songbird will be ignored by the code in nsContextMenu.js.
- Add broadcasters needed by nsContextMenu.js (ie, canGoForward, canGoBack)
- Add our own function in the content menu's onpopupshowing (similar to how Firefox calls updateEditUIVisibility) to show/hide separators based on our own logic.
- Import AddKeywordForSearchField (http://lxr.mozilla.org/seamonkey/source/browser/base/content/browser.js#5696), BrowserSearch (http://lxr.mozilla.org/seamonkey/source/browser/base/content/browser.js#2888), and InlineSpellCheckerUI (chrome://global/content/inlineSpellCheckUI.js, http://lxr.mozilla.org/seamonkey/source/toolkit/content/inlineSpellCheckUI.js). (more?)
- Hook up content context menu (currently only triggered when right clicking on html links).
Known Risks
- Although it should be possible to reuse nsContextMenu.js from Firefox as-is, as long as the steps detailed in the Additional Engineering Notes are followed, there is still a risk that something has been overlooked that makes this impossible and forces us to fork this module (for instance this would be the case if that script did not cleanly ignore showing/hiding items that are not there). The short term impact would be small to negligeable (it is easy to fork the script, and actually makes some of tasks cleaner since we then no loger need to have our own separator ids and a separate showing/hiding logic [it can be changed directly in the script]), the long term impact is more problematic since it means that we can no longer inherit updates for this script from Firefox by simply updating the file.
Future
- Platform-specific shortcut keys (current design is based on Firefox shortcut keys for Windows)
Notes
Komi 15:56, 17 Jan 2008 (PST) Seeding document
Komi 18:24, 17 Jan 2008 (PST) rm some image-specific items because Songbird is a media player that knows little about images
Komi 19:02, 17 Jan 2008 (PST) Asked Ian and Matt for feedback, compiled a fuzzy cost
Komi 14:38, 18 Jan 2008 (PST) added back "Save Link As..."
Komi 17:34, 25 Jan 2008 (PST) marking doc complete
Komi 01:15, 4 March 2008 (PST) TODO: Add "Download to Device" and "Download to Library"
Komi 01:17, 4 March 2008 (PST) I guess matt and I costed this a while back? This feature is estimated at 8 points
Komi 13:23, 4 March 2008 (PST) increased estimate to 10 after conversation with Mook.



