SafariExtensionContextMenuItemValidateEvent Class Reference
| Inherits from | |
| Technology area | Safari Extensions |
| Availability | Available in Safari 5.0 and later. |
Overview
Instances of the SafariExtensionContextMenuItemValidateEvent class are used to notify listeners when a context menu is about to be displayed.
Each time a contextual menu is about to be displayed, Safari creates a new menu, populated with the default menu items from your extension’s Info.plist file. Next, a SafariExtensionContextMenuEvent event is sent, and its listeners add menu items to the menu. Then a SafariExtensionContextMenuItemValidateEvent event is sent for each menu item, and its listeners have the opportunity to prevent items in the context menu from being displayed by marking them as disabled.
The event type for this class is validate.
Properties
userInfo
Information about the current context menu event.
readonly attribute any userInfo
Discussion
From within the web content area, you listen for a DOM context menu event, and then call the setContextMenuEventUserInfo method. The value you provide is used as the userInfo property by the SafariExtensionContextMenuEvent and SafariExtensionContextMenuItemValidateEvent events when they are sent.
Availability
- Available in Safari 5.0 and later.
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-07-13)