[Webkit-unassigned] [Bug 199793] New: WKWebView PDF viewer doesn't respect selection and callout preferences
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jul 15 01:17:12 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=199793
Bug ID: 199793
Summary: WKWebView PDF viewer doesn't respect selection and
callout preferences
Product: WebKit
Version: Other
Hardware: All
OS: iOS 12
Status: NEW
Severity: Normal
Priority: P2
Component: PDF
Assignee: webkit-unassigned at lists.webkit.org
Reporter: josip04 at hotmail.com
I am trying to disable Copy callout on `WKWebView` for all document types.
Try 1 (JavaScript):
WebKit built in PDF viewer doesn't respect selection and callout preferences set on `WKWebView`.
Executing this JS `document.documentElement.style.webkitUserSelect='none';` in web view that contains PDF doesn't do anything it seems. This works well for any other document type as far as I can tell.
Try 2 (responder chain)
Subclassing `WKWebView` and overriding `canPerformAction` doesn't help either. It seems that this is being called for some actions but not Copy. My guess is that some object deeper in hierarchy (maybe `PDFHostViewController`?) overrides this method and allows Copy action.
All I can think of is to play with private view hierarchies and swizzle this method to hook in behaviour that I need. Are there any other workarounds?
Since PDF preview is transparent for `WKWebView` users I feel both of these approaches should work out of the box?
I am seeing the same behaviour on macOS and iOS.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190715/0da42e42/attachment.html>
More information about the webkit-unassigned
mailing list