From ffb6ff932588fc2a00e2ec6ec586dae40c83ffad Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 19 Oct 2019 22:32:49 -0400 Subject: Allow multiple options pages to be opened on middle click --- ext/bg/js/api.js | 10 ++++++++-- 1 file 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 () => { -- cgit v1.2.3