fix: replace <object> PDF preview with open/download buttons for mobile#5907
Open
chphch wants to merge 2 commits intofilebrowser:masterfrom
Open
fix: replace <object> PDF preview with open/download buttons for mobile#5907chphch wants to merge 2 commits intofilebrowser:masterfrom
chphch wants to merge 2 commits intofilebrowser:masterfrom
Conversation
…le compatibility The <object> tag fails silently on iOS Safari (black screen) and Android Chrome (PDF plugin unavailable). Replace with open/download buttons that launch the native browser PDF viewer in a new tab, using the existing directUrl and downloadUrl computed properties. Fixes filebrowser#5906 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Member
|
Removing the desktop ability to display the pdf directly because mobile has no support for it doesn't seem the correct approach. Browsers provides the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<object v-else-if="isPdf">with open/download buttonsdirectUrlanddownloadUrlcomputed properties — no new codefrontend/src/views/files/Preview.vue)Fixes #5906
Related: #3317 (iOS black screen), #3583 (Android PDF plugin)
Before / After
Before:
<object>tag — renders on desktop Chrome/Firefox, fails silently on mobileAfter: Open in new tab + Download buttons — works on all platforms, consistent with the existing blob/unsupported file UI pattern
Test plan
🤖 Generated with Claude Code
via Happy