RESOLVED FIXED212795
Add WKUIDelegate SPI to confirm before opening a PDF
https://bugs.webkit.org/show_bug.cgi?id=212795
Summary Add WKUIDelegate SPI to confirm before opening a PDF
Alex Christensen
Reported 2020-06-04 18:04:42 PDT
Add WKUIDelegate SPI to confirm before opening a PDF
Attachments
Patch (17.17 KB, patch)
2020-06-04 18:05 PDT, Alex Christensen
no flags
Patch (17.19 KB, patch)
2020-06-04 20:00 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2020-06-04 18:05:38 PDT
Alex Christensen
Comment 2 2020-06-04 18:05:40 PDT
Tim Horton
Comment 3 2020-06-04 18:12:29 PDT
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
Alex Christensen
Comment 4 2020-06-04 20:00:47 PDT
EWS
Comment 5 2020-06-04 20:28:50 PDT
Committed r262592: <https://trac.webkit.org/changeset/262592> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401110 [details].
Darin Adler
Comment 6 2020-06-05 12:49:00 PDT
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.
Tim Horton
Comment 7 2020-06-05 12:51:52 PDT
Oh no, I must need glasses :|
Alex Christensen
Comment 8 2020-06-05 13:16:30 PDT
Oops! That's what I get for making the code look nicer after verifying it works. http://trac.webkit.org/r262649
Note You need to log in before you can comment on or make changes to this bug.