From 5f01f783e2387a5d44ad70fbff5365aa0e5df938 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 6 Nov 2016 20:47:31 +0100 Subject: Fixed svgpan.js issue with Chrome causing empty SVG graphs --- templates/html/svgpan.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/html/svgpan.js b/templates/html/svgpan.js index 4218e79..db9fcb9 100644 --- a/templates/html/svgpan.js +++ b/templates/html/svgpan.js @@ -89,9 +89,13 @@ function show() function init(evt) { svgDoc = evt.target.ownerDocument; - if (top.window && top.window.registerShow) // register show function in html doc for dynamic sections - { - top.window.registerShow(sectionId,show); + try { + if (top.window && top.window.registerShow) { // register show function in html doc for dynamic sections + top.window.registerShow(sectionId,show); + } + } catch(e) { + // ugh, we are not allowed to talk to the parent; can happen with Chrome when viewing pages + // locally, since they treat every local page as having a different origin } show(); -- cgit v0.12