WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
226509
[iOS] Need API to save currently-displayed PDF blob
https://bugs.webkit.org/show_bug.cgi?id=226509
Summary
[iOS] Need API to save currently-displayed PDF blob
Ali Juma
Reported
2021-06-01 12:59:56 PDT
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-06-08 13:00:21 PDT
<
rdar://problem/79029343
>
Sam Sneddon [:gsnedders]
Comment 2
2022-05-09 07:42:28 PDT
rdar://78728238
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug