diff options
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r-- | ext/js/background/backend.js | 17 |
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; |