From MozillaWiki
Jump to: navigation, search


In many situations, context menus are dynamic. Why not let the user decide if they are interested in the node presented by letting them provide a callback function? I know this is problematic, there is a trust issue with calling 3rd party code before the user decides to pick that option. However the goal for JetPack is to make JetPacks first class citizens along with XPI; that isn't going to happen unless we extend some trust at the API level.

I propose we let the user during the add() method, provide a function that tests the node during context menu display.

As a usecase for this JEP: My script wants to add a context menu item for flickr images only. When the context menu item is clicked, it will go to the exif flickr page for the image. -- BlindWanderer 17:43, 3 February 2010 (UTC)

Bottom-up doesn't scale well as (you) noted in the description. The on() method of Top-down could be overloaded to accept a DOM node as well as a string (a stopgap between the two). The add() method should probably also be added to the object returned by page() so that it is obvious that a command is intended for all nodes. -- BlindWanderer 17:58, 3 February 2010 (UTC)