Reputation: 36896
I am developing a webkit application for public release, and wondering how to deal with context menus.
The problem is there are items in Safari's default context menu that I don't want to show end users:
Possibly others. So, question #1 is: Is it possible to remove items selectively from the default context menu?
Another option is to create my own context menu from scratch, but then comes a host of other problems:
textarea
s, or accessibility features.So the main question is in general, What should I do to preserve default functionality in Safari's context menu, while restricting certain things like "reload", "Inspect Element"?
Upvotes: 2
Views: 298
Reputation: 351
Couldn't you use the WebUIDelegate protocol method?
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
You should be able to take the defaultItems, add the ones you want to keep to a new array, and then return said array?
Upvotes: 1