summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-08 15:53:06 -0500
committerGitHub <noreply@github.com>2020-11-08 15:53:06 -0500
commit4e3040941038acc4f739e4077aee14cb64d3aa81 (patch)
treea9c4e19afeba313d5b9b942b4e75f7d06e44475e /ext/bg/js/backend.js
parent0cbc6523e67ccae01d1a4d7547ef38017594c149 (diff)
Add api.isAnkiConnected (#1011)
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index fe9c9c76..3f00994a 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -83,6 +83,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)}],
+ ['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)}],
['injectAnkiNoteMedia', {async: true, contentScript: true, handler: this._onApiInjectAnkiNoteMedia.bind(this)}],
@@ -420,6 +421,10 @@ class Backend {
return results;
}
+ async _onApiIsAnkiConnected() {
+ return await this._anki.isConnected();
+ }
+
async _onApiAddAnkiNote({note}) {
return await this._anki.addNote(note);
}