From 6076dd97af3eace0b884af00bb99ee0d0742a25f Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Tue, 28 Nov 2017 22:32:18 +0100 Subject: [PATCH] Handle situation where iframe already has the given URL open --- infodisplay/infodisplay.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/infodisplay/infodisplay.js b/infodisplay/infodisplay.js index e2ab664..549332f 100644 --- a/infodisplay/infodisplay.js +++ b/infodisplay/infodisplay.js @@ -47,6 +47,13 @@ function DisplayParticipant(broker, role, defaultUrls, timer) { urls = indata; callback('urls', null, urls); } + if (next.getAttribute('src') === indata) { + // Already open! + next.id = 'current'; + current.id = 'next'; + callback('opened', null, next.getAttribute('src')); + return; + } next.onerror = (err) => { next.onload = null; next.onerror = null;