Change: activate manager in other windows

This commit is contained in:
eight 2020-02-01 16:40:51 +08:00
parent 898251ce4a
commit 9fda82f7cb

View File

@ -102,8 +102,7 @@ function initPopup() {
}); });
$('#popup-options-button').onclick = () => { $('#popup-options-button').onclick = () => {
// FIXME: should we set currentWindow: null? API.openURL({url: 'manage.html#stylus-options', currentWindow: null});
API.openURL({url: 'manage.html#stylus-options'});
window.close(); window.close();
}; };
@ -590,11 +589,12 @@ Object.assign(handleEvent, {
if (event.button === 2 && unsupportedURL) return; if (event.button === 2 && unsupportedURL) return;
event.preventDefault(); event.preventDefault();
if (!this.eventHandled) { if (!this.eventHandled) {
// FIXME: this only works if popup is closed
this.eventHandled = true; this.eventHandled = true;
this.dataset.href += event.shiftKey || event.button === 2 ? this.dataset.href += event.shiftKey || event.button === 2 ?
'?search=' + encodeURIComponent(`url:${tabURL}`) : ''; '?search=' + encodeURIComponent(`url:${tabURL}`) : '';
// FIXME: should we set currentWindow: null? API.openURL({url: this.dataset.href, currentWindow: null});
handleEvent.openURLandHide.call(this, event); window.close();
} }
}, },