From db18e95a9b76b8bc296c9da7131187fb46ae5865 Mon Sep 17 00:00:00 2001 From: hackademix Date: Thu, 30 Jan 2020 22:52:30 +0100 Subject: Fixed autoreload after popup closing broken on Vivaldi. --- src/ui/popup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/popup.js b/src/ui/popup.js index 4b5dc85..07c21e4 100644 --- a/src/ui/popup.js +++ b/src/ui/popup.js @@ -1,7 +1,7 @@ 'use strict'; var sitesUI; - +var port; addEventListener("unload", e => { if (!UI.initialized) { Messages.send("openStandalonePopup"); @@ -43,7 +43,7 @@ addEventListener("unload", e => { tabId = tab.id; } - let port = browser.runtime.connect({name: "noscript.popup"}); + port = browser.runtime.connect({name: "noscript.popup"}); await UI.init(tabId); function pendingReload(b) { @@ -272,6 +272,7 @@ addEventListener("unload", e => { }); addEventListener("blur", e => { onCompleted.removeListener(onCompletedListener); + port.disconnect(); // otherwise Vivaldi keeps it after closing }); } catch (e) { error(e, "Can't open popup"); -- cgit v1.2.3