summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhackademix2020-01-30 22:52:30 +0100
committerhackademix2020-01-30 22:56:14 +0100
commitdb18e95a9b76b8bc296c9da7131187fb46ae5865 (patch)
tree6815347f32c36800e80efd2479d1104046e62343 /src
parent927851e0fea54957d6fb25242085342aea979fa6 (diff)
downloadnoscript-db18e95a9b76b8bc296c9da7131187fb46ae5865.tar.gz
noscript-db18e95a9b76b8bc296c9da7131187fb46ae5865.tar.xz
noscript-db18e95a9b76b8bc296c9da7131187fb46ae5865.zip
Fixed autoreload after popup closing broken on Vivaldi.
Diffstat (limited to 'src')
-rw-r--r--src/ui/popup.js5
1 files changed, 3 insertions, 2 deletions
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");