aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index f9c308e5..012036dc 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -790,12 +790,25 @@ class Backend {
}
_onCommandOptions(params) {
+ const {useSettingsV2} = this._options.global;
const {mode='existingOrNewTab'} = params || {};
if (mode === 'existingOrNewTab') {
+ if (useSettingsV2) {
+ (async () => {
+ const url = chrome.runtime.getURL('/bg/settings2.html');
+ const tab = await this._findTab(1000, (url2) => url2.startsWith(url));
+ if (tab !== null) {
+ await this._focusTab(tab);
+ } else {
+ chrome.tabs.create({url});
+ }
+ })();
+ return;
+ }
chrome.runtime.openOptionsPage();
} else if (mode === 'newTab') {
const manifest = chrome.runtime.getManifest();
- const url = chrome.runtime.getURL(manifest.options_ui.page);
+ const url = chrome.runtime.getURL(useSettingsV2 ? '/bg/settings2.html' : manifest.options_ui.page);
chrome.tabs.create({url});
}
}