Skip to content

Commit

Permalink
Links in pdfs should no longer open in the iframe.
Browse files Browse the repository at this point in the history
Instead, they should open in a new tab/window

Changing test to match pdf template change/fix
  • Loading branch information
AddisonSchiller authored and felliott committed Nov 13, 2017
1 parent dd5dd3e commit 784f80f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mfr/extensions/pdf/templates/viewer.mako
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ http://sourceforge.net/adobe/cmap/wiki/License/
-->
<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
<head>
<base href="${base}/web/">
<base href="${base}/web/" target="_blank">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate">
Expand Down
2 changes: 1 addition & 1 deletion mfr/server/static/js/mfr.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
self.pymParent.iframe.setAttribute('allowfullscreen', '');
self.pymParent.iframe.setAttribute('webkitallowfullscreen', '');
self.pymParent.iframe.setAttribute('scrolling', 'yes');
self.pymParent.iframe.setAttribute('sandbox', 'allow-scripts');
self.pymParent.iframe.setAttribute('sandbox', 'allow-scripts allow-popups');

self.pymParent.el.appendChild(self.spinner);
$(self.pymParent.iframe).on('load', function () {
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/pdf/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ class TestPdfRenderer:

def test_render_pdf(self, renderer, metadata, assets_url):
body = renderer.render()
assert '<base href="{}/{}/web/">'.format(assets_url, 'pdf') in body
assert '<base href="{}/{}/web/" target="_blank">'.format(assets_url, 'pdf') in body
assert '<div id="viewer" class="pdfViewer"></div>' in body
assert 'DEFAULT_URL = \'{}\''.format(metadata.download_url) in body

0 comments on commit 784f80f

Please sign in to comment.