aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-19 22:32:49 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-19 22:34:47 -0400
commitffb6ff932588fc2a00e2ec6ec586dae40c83ffad (patch)
treec78f5e6f11d93a0db4a05303bfcaf79ca7fa6840 /ext/bg/js
parentd9ae34821ca5e0189248c015c2f30b88a8a6a7b2 (diff)
Allow multiple options pages to be opened on middle click
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/api.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 7b806e27..e8379d10 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -176,8 +176,14 @@ apiCommandExec.handlers = {
chrome.tabs.create({url: 'https://foosoft.net/projects/yomichan/'});
},
- options: () => {
- chrome.runtime.openOptionsPage();
+ options: (params) => {
+ if (!(params && params.newTab)) {
+ chrome.runtime.openOptionsPage();
+ } else {
+ const manifest = chrome.runtime.getManifest();
+ const url = chrome.extension.getURL(manifest.options_ui.page);
+ chrome.tabs.create({url});
+ }
},
toggle: async () => {