aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authorKuuuube <61125188+Kuuuube@users.noreply.github.com>2024-05-12 21:54:45 -0400
committerGitHub <noreply@github.com>2024-05-13 01:54:45 +0000
commitfc83365f1f1163fa990d5377f9b20512594631d7 (patch)
tree97cea2c2bea60c4213840c9ad9a8299d98fb39c8 /ext/js/background/backend.js
parentd5c28a3b3aee933a6d54ca62877a83e0505cb894 (diff)
Restore shift click behavior for search button opening as a popup (#920)
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js17
1 files changed, 10 insertions, 7 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;