summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-12 14:57:24 -0500
committerGitHub <noreply@github.com>2020-12-12 14:57:24 -0500
commit5948229176d9a23f1a8fe9f7125c32bece34f100 (patch)
tree23b24b78bd5427680fd0ffca2a509f44eb2f6bfb /ext/bg/js/backend.js
parent92cfd31c0faf333c3affb2c9a7b14c4960cf156a (diff)
Add info page (#1102)
* Add api.getAnkiConnectVersion * Enable basic functionality when certain features/elements aren't present * Add info page * Update information links * Update info link on the settings v2 page
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 012036dc..b2ea3cd6 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -90,6 +90,7 @@ class Backend {
['kanjiFind', {async: true, contentScript: true, handler: this._onApiKanjiFind.bind(this)}],
['termsFind', {async: true, contentScript: true, handler: this._onApiTermsFind.bind(this)}],
['textParse', {async: true, contentScript: true, handler: this._onApiTextParse.bind(this)}],
+ ['getAnkiConnectVersion', {async: true, contentScript: true, handler: this._onApGetAnkiConnectVersion.bind(this)}],
['isAnkiConnected', {async: true, contentScript: true, handler: this._onApiIsAnkiConnected.bind(this)}],
['addAnkiNote', {async: true, contentScript: true, handler: this._onApiAddAnkiNote.bind(this)}],
['getAnkiNoteInfo', {async: true, contentScript: true, handler: this._onApiGetAnkiNoteInfo.bind(this)}],
@@ -428,6 +429,10 @@ class Backend {
return results;
}
+ async _onApGetAnkiConnectVersion() {
+ return await this._anki.getVersion();
+ }
+
async _onApiIsAnkiConnected() {
return await this._anki.isConnected();
}
@@ -786,7 +791,8 @@ class Backend {
}
_onCommandHelp() {
- chrome.tabs.create({url: 'https://foosoft.net/projects/yomichan/'});
+ const url = chrome.runtime.getURL('/bg/info.html');
+ chrome.tabs.create({url});
}
_onCommandOptions(params) {