CenterForOpenScience / modular-file-renderer

A Python package for rendering files to HTML via an embeddable iframe
http://modular-file-renderer.readthedocs.io/en/latest/
Apache License 2.0
44 stars 67 forks source link

[SVCS-423] Links in pdfs should no longer open in the iframe. #273

Closed AddisonSchiller closed 7 years ago

AddisonSchiller commented 7 years ago

Instead, they should open in a new tab/window

https://openscience.atlassian.net/browse/SVCS-423

Purpose

Fix opening links in an iframe. Update tests to match fix.

Summary of changes

added default behavior of links to open in new tab, instead of on same page (in iframe) Changed MFR tests to match this behavior.

QA Notes

Open a pdf that has a link in it (example on jira ticket) Click on the link It should redirect you in a new tab, instead of in the iframe.

Mfr pdf tests should pass

cslzchen commented 7 years ago

@AddisonSchiller FYI, not sure if relevant since I am not familiar with PDF rendering in HTML. I did two tests. I had had doubt in the base tag in the following cases but it turned out I was wrong.

First, I tested a PDF file with bookmark links. It worked as expected (no new tab). Second, I tested a PDF file with absolute web page link. It worked as expected as well (new tab).

Here is the file that I used: MFR_Test_2.pdf

AddisonSchiller commented 7 years ago

fixed. Sorta killed the commit for it when merging. Anyway, sandboxing just needed 'allow-popups'.

https://stackoverflow.com/questions/21236616/sandboxed-iframe-with-target-blank-doesnt-open-new-tab-or-window

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 7021488f9e1bee8d35400ff97d4cceb5a94e4807 on AddisonSchiller:feature/link-in-pdf-fix into on CenterForOpenScience:develop.

felliott commented 7 years ago

yaaaaaaaaaaaaaaaaaaaay. merged.