Add WKUIDelegate SPI to confirm before opening a PDF
Created attachment 401106 [details] Patch
<rdar://problem/58715847>
Comment on attachment 401106 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401106&action=review > Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:118 > +- (void)_webView:(WKWebView *)webView confirmPDFOpeningFromFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); I don't love the name. I don't have a great alternative. shouldAllowPDFToOpenFromFrame? canOpenPDFFromFrame? > Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:510 > + FileSystem::setMetadataURL(nsPath.get(), originatingURLString); Nice
Created attachment 401110 [details] Patch
Committed r262592: <https://trac.webkit.org/changeset/262592> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401110 [details].
Comment on attachment 401110 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401110&action=review > Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:517 > + if (allowed) > + return; > + [[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:nsPath.get() isDirectory:NO]]; This reads as if it’s backwards. > Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:533 > + if (allowed) > + return; > + [[NSWorkspace sharedWorkspace] openURL:[NSURL fileURLWithPath:pdfFilename isDirectory:NO]]; This reads as if it’s backwards.
Oh no, I must need glasses :|
Oops! That's what I get for making the code look nicer after verifying it works. http://trac.webkit.org/r262649