Steps to reproduce: 1. Visit https://alijuma.github.io/test-pdf.html 2. Tap on “Generate” This produces a PDF blob and then loads this PDF. In Safari, it’s possible to save this PDF (tap on the sharing icon, and then “Save to Files”). However, a WKWebView embedder like Chrome cannot implement the same functionality since there’s no API to save the currently-displayed PDF. Since the blob object no longer exists (since we navigated away from it), the WKWebView download API doesn’t work (the load fails with a WebKitBlobResource error). Also, since the blob link produced in step (2) doesn’t have a ‘download’ attribute, WKNavigationAction’s |shouldPerformDownload| attribute was false on navigation to the PDF, so the embedder would not have preemptively downloaded the file. Safari seems to be using SPI to save the PDF after it’s displayed. WKWebView’s |_getMainResourceDataWithCompletionHandler:| SPI does work in this case, so making this public would be one way to address this issue. I've also filed FB9124664 for this.
<rdar://problem/79029343>
rdar://78728238