RESOLVED FIXED 183526
Allow NavigationState to intercept requests and send them to SystemPreviewController
https://bugs.webkit.org/show_bug.cgi?id=183526
Summary Allow NavigationState to intercept requests and send them to SystemPreviewCon...
Dean Jackson
Reported 2018-03-09 14:32:59 PST
Allow NavigationState to intercept requests and send them to SystemPreviewController
Attachments
Patch (9.94 KB, patch)
2018-03-09 14:40 PST, Dean Jackson
thorton: review+
Dean Jackson
Comment 1 2018-03-09 14:33:35 PST
Dean Jackson
Comment 2 2018-03-09 14:40:58 PST
EWS Watchlist
Comment 3 2018-03-09 14:43:18 PST
Attachment 335466 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/SystemPreviewController.h:33: _WKPreviewControllerDataSource is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebKit/UIProcess/SystemPreviewController.h:34: _WKPreviewControllerDelegate is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 4 2018-03-09 15:24:03 PST
Comment on attachment 335466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=335466&action=review > Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 > + if (page.systemPreviewController()->canPreview(navigationResponse->response().mimeType())) > + page.systemPreviewController()->showPreview(navigationResponse->response().url()); It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download?
Dean Jackson
Comment 5 2018-03-09 15:28:20 PST
Comment on attachment 335466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=335466&action=review >> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 >> + page.systemPreviewController()->showPreview(navigationResponse->response().url()); > > It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download? I agree. But we can't nicely cancel the download at this point. Ultimately, we'll have a separate download client or logic that doesn't navigate.
Tim Horton
Comment 6 2018-03-09 15:30:07 PST
Comment on attachment 335466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=335466&action=review >>> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 >>> + page.systemPreviewController()->showPreview(navigationResponse->response().url()); >> >> It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download? > > I agree. But we can't nicely cancel the download at this point. Ultimately, we'll have a separate download client or logic that doesn't navigate. Or a separate policy type?
Dean Jackson
Comment 7 2018-03-09 15:32:36 PST
Comment on attachment 335466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=335466&action=review >>>> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:658 >>>> + page.systemPreviewController()->showPreview(navigationResponse->response().url()); >>> >>> It seems a bit weird to take over if the client explicitly wants to download, and also weird to then go ahead with the download? >> >> I agree. But we can't nicely cancel the download at this point. Ultimately, we'll have a separate download client or logic that doesn't navigate. > > Or a separate policy type? Actually, it sort of works if I ignore the download! I originally considered a new policy type, but this one is actually set from Safari. I'll have to do something else for WKWebView clients.
Dean Jackson
Comment 8 2018-03-09 15:39:40 PST
Note You need to log in before you can comment on or make changes to this bug.