From c6a0ae08f1f8a53bb25ed31dee37af791b460ce3 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 23 Jul 2018 20:12:19 +0200 Subject: [PATCH 1/3] Ensure that the `externalLinkTarget` option is correctly set when the viewer is embedded (PR 9479 follow-up) *This was a stupid error on my part; sorry about breaking this!* With the current code, the value of the `externalLinkTarget` option is now (potentially) updated *after* the viewer components have been initialized. For the "viewer in iframe/object tag" case, the result is that the value of the `externalLinkTarget` option isn't adjusted as intended any more. --- web/app.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/web/app.js b/web/app.js index 23de08761..2530329ee 100644 --- a/web/app.js +++ b/web/app.js @@ -142,6 +142,12 @@ let PDFViewerApplication = { }).then(() => { return this._initializeL10n(); }).then(() => { + if (this.isViewerEmbedded && + AppOptions.get('externalLinkTarget') === LinkTarget.NONE) { + // Prevent external links from "replacing" the viewer, + // when it's embedded in e.g. an