mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[Firefox] Restore opening of PDF attachments (issue 17353)
This unfortunately broke in PR 17060, since I had completely forgotten about https://bugzilla.mozilla.org/show_bug.cgi?id=1632644#c5 when writing that patch. The easiest solution, while slightly unfortunate, seems to be to add a couple of non-standard hash parameters specifically for the PDF attachment use-case in the Firefox PDF Viewer. (Note that we cannot use "nameddest" here, since we also need to support the stringified destination-Array case.)
This commit is contained in:
parent
096426f073
commit
4c92ec9008
2 changed files with 35 additions and 24 deletions
|
@ -112,9 +112,11 @@ class DownloadManager {
|
|||
this.#openBlobUrls.set(data, blobUrl);
|
||||
}
|
||||
// Let Firefox's content handler catch the URL and display the PDF.
|
||||
let viewerUrl = blobUrl + "?filename=" + encodeURIComponent(filename);
|
||||
// NOTE: This cannot use a query string for the filename, see
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1632644#c5
|
||||
let viewerUrl = blobUrl + "#filename=" + encodeURIComponent(filename);
|
||||
if (dest) {
|
||||
viewerUrl += `#${escape(dest)}`;
|
||||
viewerUrl += `&filedest=${escape(dest)}`;
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue