Safari 10.0.2 + Safari App Extension to add ability for contextual menu items to change titles and be removed

Originator:nbeadman
Number:rdar://29832631 Date Originated:30-Dec-2016 12:00 PM
Status:Open Resolved:
Product:Safari Product Version:Safari 10.0.2 (11602.3.12.0.1)
Classification:Enhancement Reproducible:Always
 
Summary:

I have a Safari App Extension that adds contextual menu items. These menu items are only useful when the contextual menu event target is a recognized URL. If the URL is useful then I change the contextual menu item to include the ‘filename’ that the URL includes, if the URL is not recognized then I disable my contextual menu item.

Neither of these features are available to Contextual Menu Items in Safari App Extensions.

Regression:

Without being able to change the text of the contextual menu item or disable (remove) it the contextual menu has items in it that are not useful and if selected result in an error dialog. It is much better for those not to be present or have more information for the user to decide whether the action is something they actually want to do.

Notes:

I have attached my current Safari (JavaScript) Extension where you can see how I use the URL and enable/disable the menu items.

Due to the changes made to Safari 10, the JavaScript Extension prompts the user every time the item is selected (rdar://29832579) so a Safari App Extension is the only possible solution.

Comments

Duplicate of 24824014


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!