Index: openacs-4/packages/proctoring-support/www/resources/proctored-page.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/www/resources/proctored-page.js,v diff -u -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/proctoring-support/www/resources/proctored-page.js 7 Oct 2020 14:33:00 -0000 1.1.2.14 +++ openacs-4/packages/proctoring-support/www/resources/proctored-page.js 8 Oct 2020 14:04:10 -0000 1.1.2.15 @@ -40,13 +40,24 @@ iframe.setAttribute("class", "embed-responsive-item"); iframe.setAttribute("id", "proctored-iframe-" + objectId); iframe.addEventListener("load", function(e) { - // Prevent loops of iframes: bring the iframe to the - // start when we detect it would land on the very URL - // of this page - var parentURL = location.href + location.search; - var iframeURL = this.contentWindow.location.href + this.contentWindow.location.search; - if (parentURL == iframeURL) { - this.src = objectURL; + try { + // Prevent loops of iframes: bring the iframe to the + // start when we detect it would land on the very URL + // of this page. + var parentURL = location.href + location.search; + var iframeURL = this.contentWindow.location.href + this.contentWindow.location.search; + if (parentURL == iframeURL) { + this.src = objectURL; + } + } catch (e) { + // Accessing the properties of an iframe fetching from a + // cross-origin website is forbidden. This is fine in this + // case as the URL is most definitely not looping. + if (e.name === "SecurityError") { + console.log("iframe URL is most likely an external one"); + } else { + console.error(e); + } } console.log("iframe loaded"); });