reload popup fix
This commit is contained in:
parent
839bd4e8fc
commit
9597e76e92
|
@ -34,13 +34,12 @@ export default class RuntimeBackground {
|
||||||
// Reload the popup when it's opened
|
// Reload the popup when it's opened
|
||||||
this.runtime.addEventListener('popover', (event: any) => {
|
this.runtime.addEventListener('popover', (event: any) => {
|
||||||
const win: Window = event.target.contentWindow;
|
const win: Window = event.target.contentWindow;
|
||||||
const body = win.document.body;
|
const href = win.location.origin + win.location.pathname;
|
||||||
let child: Node = body.firstChild;
|
if(win.location.toString() === href) {
|
||||||
while (child) {
|
|
||||||
body.removeChild(child);
|
|
||||||
child = body.firstChild;
|
|
||||||
}
|
|
||||||
win.location.reload();
|
win.location.reload();
|
||||||
|
} else {
|
||||||
|
win.location.href = href;
|
||||||
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue