Skip to content
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

Really enable Chromium to display PDFs in the viewer iframe #930

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

veloman-yunkan
Copy link
Collaborator

@veloman-yunkan veloman-yunkan commented Apr 10, 2023

Fixes #916

The previous "fix" (merged PR #924) was buggy. It not only didn't work in Chromium v90, but in more recent versions too.

I verified that this fix works in Firefox (v111) and Chromium (v90):

  • Attempts by the ZIM content to break out of the viewer iframe are blocked.
  • PDFs are displayed in the viewer.

Also (unrelated to the bug being addressed) removed moz-extension: and chrome-extension: from list of valid sources in content security policy as they are not justified for kiwix-serve (as noted in @Jaifroid's review of #924)

The previous "fix" (merged PR #924) was buggy. It not only didn't work
in Chromium v90, but in more recent versions too.

I verified that this fix works in Firefox (v111) and Chromium (v90):

- Attempts by the ZIM content to break out of the viewer iframe are
blocked.
- PDFs are displayed in the viewer.
Copy link
Member

@mgautierfr mgautierfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Waiting for @rgaudin or @Jaifroid which was more involved in this issue to confirm and we can merge.

Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well but I didn't test. I can't compile libzim on my box (openzim/libzim#778) and on an ubuntu one, it compiles but the test fails…

@kelson42
Copy link
Collaborator

Mandatory to me is the approval of @Jaifroid

@kelson42
Copy link
Collaborator

@veloman-yunkan @mgautierfr macos CI fails!

@rgaudin
Copy link
Member

rgaudin commented Apr 11, 2023

@veloman-yunkan @mgautierfr macos CI fails!

It's no one's fault. We install packages via brew and one of the package's dependency is python which can't be linked because it's already linked.

I believe passing --overwrite to the brew install command could fix it but it's unrelated to this PR

@kelson42
Copy link
Collaborator

Another issue/PR needs then probably to be open asap.

@Jaifroid
Copy link
Member

Sorry, I'm still 7 hours behind CET, will review shortly.

Copy link
Member

@Jaifroid Jaifroid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me with one query about the PDF MIME type which may just be over-cautious. N.B. I can't test because I can't build this on my Windows machine. I'll happily test it thoroughly once it has been merged and is available in the dev server.

src/server/internalServer.cpp Show resolved Hide resolved
@mgautierfr
Copy link
Member

Seems we are good. I'm merging.

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

Successfully merging this pull request may close these issues.

PDF content blocked by Chrome
5 participants