Skip to content

[GENERIC viewer] Always show the Download-buttons, to allow saving of forms (issue 13997) #14005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Originally the library/viewer didn't support forms, and the hiding of the Download-buttons (when new documents are opened) didn't really matter all that much. Hence the simplest solution, at the time, was to hide the Download-buttons since we use the URL as a fallback when downloading data in the GENERIC DownloadManager.
Nowadays we obviously want to support saving of forms in the GENERIC viewer, regardless of how the document was opened, which could thus potentially lead to the fallback download-URL being wrong.

In order to be able to show the Download-buttons unconditionally, this patch slightly re-factors the viewer to track the download-URL separately to prevent any issues there.

Please note: As mentioned in the issue, the ViewBookmark-buttons are specific to the initial URL when the viewer is first opened. Hence they (still) don't make sense when a new document has been opened, since it's then impossible to obtain a usable link to the currently active document.

Fixes #13997

@timvandermeij
Copy link
Contributor

/botio-linux preview

@mozilla mozilla deleted a comment from pdfjsbot Sep 12, 2021
@mozilla mozilla deleted a comment from pdfjsbot Sep 12, 2021
@mozilla mozilla deleted a comment from pdfjsbot Sep 12, 2021
@mozilla mozilla deleted a comment from pdfjsbot Sep 12, 2021
… forms (issue 13997)

Originally the library/viewer didn't support forms, and the hiding of the Download-buttons (when new documents are opened) didn't really matter all that much. Hence the simplest solution, at the time, was to hide the Download-buttons since we use the URL as a fallback when downloading data in the GENERIC `DownloadManager`.
Nowadays we obviously want to support saving of forms in the GENERIC viewer, regardless of how the document was opened, which could thus *potentially* lead to the fallback download-URL being wrong.

In order to be able to show the Download-buttons unconditionally, this patch slightly re-factors the viewer to track the download-URL *separately* to prevent any issues there.

*Please note:* As mentioned in the issue, the ViewBookmark-buttons are specific to the initial URL when the viewer is first opened. Hence they (still) don't make sense when a new document has been opened, since it's then impossible to obtain a usable link to the *currently* active document.
@mozilla mozilla deleted a comment from pdfjsbot Sep 15, 2021
@mozilla mozilla deleted a comment from pdfjsbot Sep 15, 2021
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/a119f34f6c9e779/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/a119f34f6c9e779/output.txt

Total script time: 4.94 mins

Published

@timvandermeij timvandermeij merged commit 2375318 into mozilla:master Sep 18, 2021
@timvandermeij
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download button disappears after opening a pdf
3 participants