[Webkit-unassigned] [Bug 226509] New: [iOS] Need API to save currently-displayed PDF blob
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 1 12:59:56 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=226509
Bug ID: 226509
Summary: [iOS] Need API to save currently-displayed PDF blob
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: WebKit API
Assignee: webkit-unassigned at lists.webkit.org
Reporter: ajuma at chromium.org
CC: gambard at chromium.org
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.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210601/4d6b75f4/attachment-0001.htm>
More information about the webkit-unassigned
mailing list