| Summary: | WKUIDelegate's contextMenuConfigurationForElement API method isn't called for images | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ali Juma <ajuma> |
| Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | achristensen, beidson, dino, gambard, rohitrao, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
This API was designed to be a replacement for the API it deprecated without substantial changes. We are considering improving the context menu API, and this input is noted. |
The public API method -[WKUIDelegate webView:contextMenuConfigurationForElement:completionHandler] is only called for links, not for images. The SPI version (-[WKUIDelegate _webView:contextMenuConfigurationForElement:completionHandler]) does get called for images. This means that WKWebView embedders cannot easily customize the context menu shown for images. The logic for this is in -[WKContentViewInteraction continueContextMenuInteraction:], which does: if (_positionInformation.isLink && [uiDelegate respondsToSelector:@selector(webView:contextMenuConfigurationForElement:completionHandler:)]) { ..... } else if ([uiDelegate respondsToSelector:@selector(_webView:contextMenuConfigurationForElement:completionHandler:)]) { ..... } Could we change the first condition to also include |_positionInformation.isImage|?