diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-12-06 21:17:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-06 21:17:05 -0500 |
commit | 35fbc76df441756e5044bcc9784ab3219a8d6701 (patch) | |
tree | a9f102238ae21836c89ca41e5f93a87a34797e1a /ext/bg/js/context-main.js | |
parent | 88b8191ac2946c02ef8f9a73cd2c4050b1f02f61 (diff) |
Settings v2 testing setup (#1084)
* Add option for using settings v2
* Add options/info about settings v2
* Use settings v2 URL when applicable
* Update tests
Diffstat (limited to 'ext/bg/js/context-main.js')
-rw-r--r-- | ext/bg/js/context-main.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/bg/js/context-main.js b/ext/bg/js/context-main.js index 93eebe72..b6736fd8 100644 --- a/ext/bg/js/context-main.js +++ b/ext/bg/js/context-main.js @@ -30,12 +30,14 @@ class DisplayController { this._showExtensionInfo(manifest); this._setupEnvironment(); this._setupButtonEvents('.action-open-search', 'search', chrome.runtime.getURL('/bg/search.html')); - this._setupButtonEvents('.action-open-options', 'options', chrome.runtime.getURL(manifest.options_ui.page)); this._setupButtonEvents('.action-open-help', 'help', 'https://foosoft.net/projects/yomichan/'); const optionsFull = await api.optionsGetFull(); this._optionsFull = optionsFull; + const optionsPageUrl = optionsFull.global.useSettingsV2 ? '/bg/settings2.html' : manifest.options_ui.page; + this._setupButtonEvents('.action-open-options', 'options', chrome.runtime.getURL(optionsPageUrl)); + const {profiles, profileCurrent} = optionsFull; const primaryProfile = (profileCurrent >= 0 && profileCurrent < profiles.length) ? profiles[profileCurrent] : null; if (primaryProfile !== null) { |