From 56a8bd2764bcc2c42ab0a660f4abc38919c91813 Mon Sep 17 00:00:00 2001 From: Arnaud Barisain-Monrose Date: Thu, 18 Feb 2021 11:20:48 +0100 Subject: [PATCH] devkit: fix iframe not refreshing when loading the same URL --- devkit/README.md | 5 +---- devkit/devkit.js | 2 ++ devkit/index.html | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/devkit/README.md b/devkit/README.md index bf3469a..ce6db1c 100644 --- a/devkit/README.md +++ b/devkit/README.md @@ -10,7 +10,4 @@ The devkit will also implement `batchInAppSDK` with test values. Open index.html in a browser. Set the URL to the server serving your in-development template web page, and click `Load`. -When performing actions on `batchInAppSDK`, they will be logged on the right. - -Note: Due to how iframes work in a browser, you might need to reload the page when you update the page you're working on or it will not refresh. -You can use `Remeber URL` to save the URL you're currently displaying: it will automatically be restored on reload. \ No newline at end of file +When performing actions on `batchInAppSDK`, they will be logged on the right. \ No newline at end of file diff --git a/devkit/devkit.js b/devkit/devkit.js index 2aaa712..89b78c0 100644 --- a/devkit/devkit.js +++ b/devkit/devkit.js @@ -19,6 +19,7 @@ const app = new Vue({ formatURL: defaultFormatURL, iframe: { src: defaultFormatURL, + key: 0, }, events: [], }, @@ -29,6 +30,7 @@ const app = new Vue({ loadURL: function () { console.log("Loading ", this.formatURL); this.iframe.src = this.formatURL; + this.iframe.key = this.iframe.key + 1; }, saveURL: function () { localStorage.setItem(defaultURLLocalStorageKey, this.formatURL); diff --git a/devkit/index.html b/devkit/index.html index 7fc0dcd..2870543 100644 --- a/devkit/index.html +++ b/devkit/index.html @@ -19,7 +19,7 @@

Preview

- +