summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/js/background/backend.js17
-rw-r--r--ext/js/pages/action-popup-main.js10
2 files changed, 19 insertions, 8 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index d042a253..dfb85e05 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -964,10 +964,10 @@ export class Backend {
// Command handlers
/**
- * @param {undefined|{mode: 'existingOrNewTab'|'newTab', query?: string}} params
+ * @param {undefined|{mode: 'existingOrNewTab'|'newTab'|'popup', query?: string}} params
*/
async _onCommandOpenSearchPage(params) {
- /** @type {'existingOrNewTab'|'newTab'} */
+ /** @type {'existingOrNewTab'|'newTab'|'popup'} */
let mode = 'existingOrNewTab';
let query = '';
if (typeof params === 'object' && params !== null) {
@@ -1023,6 +1023,8 @@ export class Backend {
case 'newTab':
await this._createTab(queryUrl);
return;
+ case 'popup':
+ return;
}
}
@@ -1034,10 +1036,10 @@ export class Backend {
}
/**
- * @param {undefined|{mode: 'existingOrNewTab'|'newTab'}} params
+ * @param {undefined|{mode: 'existingOrNewTab'|'newTab'|'popup'}} params
*/
async _onCommandOpenSettingsPage(params) {
- /** @type {'existingOrNewTab'|'newTab'} */
+ /** @type {'existingOrNewTab'|'newTab'|'popup'} */
let mode = 'existingOrNewTab';
if (typeof params === 'object' && params !== null) {
mode = this._normalizeOpenSettingsPageMode(params.mode, mode);
@@ -2544,7 +2546,7 @@ export class Backend {
}
/**
- * @param {'existingOrNewTab'|'newTab'} mode
+ * @param {'existingOrNewTab'|'newTab'|'popup'} mode
*/
async _openSettingsPage(mode) {
const manifest = chrome.runtime.getManifest();
@@ -2673,13 +2675,14 @@ export class Backend {
/**
* @param {unknown} mode
- * @param {'existingOrNewTab'|'newTab'} defaultValue
- * @returns {'existingOrNewTab'|'newTab'}
+ * @param {'existingOrNewTab'|'newTab'|'popup'} defaultValue
+ * @returns {'existingOrNewTab'|'newTab'|'popup'}
*/
_normalizeOpenSettingsPageMode(mode, defaultValue) {
switch (mode) {
case 'existingOrNewTab':
case 'newTab':
+ case 'popup':
return mode;
default:
return defaultValue;
diff --git a/ext/js/pages/action-popup-main.js b/ext/js/pages/action-popup-main.js
index 4125b2d1..9689e1af 100644
--- a/ext/js/pages/action-popup-main.js
+++ b/ext/js/pages/action-popup-main.js
@@ -114,7 +114,15 @@ class DisplayController {
const result = customHandler(e);
if (typeof result !== 'undefined') { return; }
}
- void this._api.commandExec(command, {mode: e.ctrlKey ? 'newTab' : 'existingOrNewTab'});
+
+ let mode = 'existingOrNewTab';
+ if (e.ctrlKey) {
+ mode = 'newTab';
+ } else if (e.shiftKey) {
+ mode = 'popup';
+ }
+
+ void this._api.commandExec(command, {mode: mode});
e.preventDefault();
};
/**