summaryrefslogtreecommitdiff
path: root/src/bg/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bg/main.js')
-rw-r--r--src/bg/main.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/bg/main.js b/src/bg/main.js
index 6e2cdf9..fa58b3a 100644
--- a/src/bg/main.js
+++ b/src/bg/main.js
@@ -54,19 +54,23 @@
};
let Commands = {
- openPageUI() {
+ async openPageUI() {
+ if (ns.popupOpening) return;
+ ns.popupOpening = true;
+ ns.popupOpened = false;
+ let openPanel = async () => {
+ ns.popupOpening = false;
+ if (ns.popupOpened) return;
+ messageHandler.openStandalonePopup();
+ };
try {
- browser.browserAction.openPopup();
+ await browser.browserAction.openPopup();
+ setTimeout(openPanel, 500);
return;
} catch (e) {
+ openPanel();
debug(e);
}
- browser.windows.create({
- url: popupURL,
- width: 800,
- height: 600,
- type: "panel"
- });
},
togglePermissions() {},