From 498c8229e93b38f1c1575941175759a650efb2a8 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Fri, 18 Aug 2017 14:12:30 +0200 Subject: [PATCH] Make following a link inside of the iframe only fail rather than carrying the iframe away from the pad. --- www/common/sframe-boot2.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/www/common/sframe-boot2.js b/www/common/sframe-boot2.js index 8285032d2..45e32a2ca 100644 --- a/www/common/sframe-boot2.js +++ b/www/common/sframe-boot2.js @@ -10,6 +10,17 @@ define(['/common/requireconfig.js'], function (RequireConfig) { }; } + // In the event that someone clicks a link in the iframe, it's going to cause the iframe + // to navigate away from the pad which is going to be a mess. Instead we'll just reload + // the top level and then it will be simply that a link doesn't work properly. + window.onunload = function () { + window.parent.location.reload(); + }; + + // Make sure anything which might have leaked to the localstorage is always cleaned up. + try { window.localStorage.clear(); } catch (e) { } + try { window.sessionStorage.clear(); } catch (e) { } + var mkFakeStore = function () { var fakeStorage = { getItem: function (k) { return fakeStorage[k]; },