From 9fda82f7cbeb18989820265e6ba949f40f1115b8 Mon Sep 17 00:00:00 2001 From: eight Date: Sat, 1 Feb 2020 16:40:51 +0800 Subject: [PATCH] Change: activate manager in other windows --- popup/popup.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/popup/popup.js b/popup/popup.js index 5af5c961..485db445 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -102,8 +102,7 @@ function initPopup() { }); $('#popup-options-button').onclick = () => { - // FIXME: should we set currentWindow: null? - API.openURL({url: 'manage.html#stylus-options'}); + API.openURL({url: 'manage.html#stylus-options', currentWindow: null}); window.close(); }; @@ -590,11 +589,12 @@ Object.assign(handleEvent, { if (event.button === 2 && unsupportedURL) return; event.preventDefault(); if (!this.eventHandled) { + // FIXME: this only works if popup is closed this.eventHandled = true; this.dataset.href += event.shiftKey || event.button === 2 ? '?search=' + encodeURIComponent(`url:${tabURL}`) : ''; - // FIXME: should we set currentWindow: null? - handleEvent.openURLandHide.call(this, event); + API.openURL({url: this.dataset.href, currentWindow: null}); + window.close(); } },