Skip to content

pdf inline viewer showing blocked plugin on issues attachment using safari #20404

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

Closed
tyroneyeh opened this issue Jul 19, 2022 · 1 comment · Fixed by #20484
Closed

pdf inline viewer showing blocked plugin on issues attachment using safari #20404

tyroneyeh opened this issue Jul 19, 2022 · 1 comment · Fixed by #20484
Labels

Comments

@tyroneyeh
Copy link
Contributor

Description

Setting repository.mimetype_mapping .pdf=application/pdf in app.ini now displays pdf in browser
But using safari shows blocked plugins

Gitea Version

1.16.9 or latest

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

systemd

Database

PostgreSQL

@tyroneyeh tyroneyeh changed the title pdf inline viewer showing blocked plugin on problem attachment using safari pdf inline viewer showing blocked plugin on issues attachment using safari Jul 19, 2022
6543 pushed a commit that referenced this issue Jul 29, 2022
- Always respect the user's configured mime type map
- Allow more types like image/pdf/video/audio to serve with correct content-type
- Shorten cache duration of raw files to 5 minutes, matching GitHub
- Don't set `content-disposition: attachment`, let the browser decide whether it wants to download or display a file directly
- Implement rfc5987 for filenames, remove previous hack. Confirmed it working in Safari.
- Make PDF attachment work in Safari by removing `sandbox` attribute.

This change will make a lot more file types open directly in browser now. Logic should generally be more readable than before with less `if` nesting and such.

Replaces: #20460
Replaces: #20455
Fixes: #20404
silverwind added a commit to silverwind/gitea that referenced this issue Jul 29, 2022
- Always respect the user's configured mime type map
- Allow more types like image/pdf/video/audio to serve with correct content-type
- Shorten cache duration of raw files to 5 minutes, matching GitHub
- Don't set `content-disposition: attachment`, let the browser decide whether it wants to download or display a file directly
- Implement rfc5987 for filenames, remove previous hack. Confirmed it working in Safari.
- Make PDF attachment work in Safari by removing `sandbox` attribute.

This change will make a lot more file types open directly in browser now. Logic should generally be more readable than before with less `if` nesting and such.

Replaces: go-gitea#20460
Replaces: go-gitea#20455
Fixes: go-gitea#20404
6543 pushed a commit that referenced this issue Jul 30, 2022
- Always respect the user's configured mime type map
- Allow more types like image/pdf/video/audio to serve with correct content-type
- Shorten cache duration of raw files to 5 minutes, matching GitHub
- Don't set `content-disposition: attachment`, let the browser decide whether it wants to download or display a file directly
- Implement rfc5987 for filenames, remove previous hack. Confirmed it working in Safari.
- Make PDF attachment work in Safari by removing `sandbox` attribute.

This change will make a lot more file types open directly in browser now. Logic should generally be more readable than before with less `if` nesting and such.

Replaces: #20460
Replaces: #20455
Fixes: #20404
vsysoev pushed a commit to IntegraSDL/gitea that referenced this issue Aug 10, 2022
- Always respect the user's configured mime type map
- Allow more types like image/pdf/video/audio to serve with correct content-type
- Shorten cache duration of raw files to 5 minutes, matching GitHub
- Don't set `content-disposition: attachment`, let the browser decide whether it wants to download or display a file directly
- Implement rfc5987 for filenames, remove previous hack. Confirmed it working in Safari.
- Make PDF attachment work in Safari by removing `sandbox` attribute.

This change will make a lot more file types open directly in browser now. Logic should generally be more readable than before with less `if` nesting and such.

Replaces: go-gitea#20460
Replaces: go-gitea#20455
Fixes: go-gitea#20404
@tyroneyeh
Copy link
Contributor Author

tyroneyeh commented Aug 15, 2022

This problem is not solved in 1.17.0, Safari is still blocked plugin

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
1 participant