From 9597e76e92dadd6b02bf415092662be7fbaaa704 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 12 Jan 2018 12:41:51 -0500 Subject: [PATCH] reload popup fix --- src/background/runtime.background.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/background/runtime.background.ts b/src/background/runtime.background.ts index 0eb5890697..352a1fd3c6 100644 --- a/src/background/runtime.background.ts +++ b/src/background/runtime.background.ts @@ -34,13 +34,12 @@ export default class RuntimeBackground { // Reload the popup when it's opened this.runtime.addEventListener('popover', (event: any) => { const win: Window = event.target.contentWindow; - const body = win.document.body; - let child: Node = body.firstChild; - while (child) { - body.removeChild(child); - child = body.firstChild; + const href = win.location.origin + win.location.pathname; + if(win.location.toString() === href) { + win.location.reload(); + } else { + win.location.href = href; } - win.location.reload(); }, true); return;