summaryrefslogtreecommitdiff
path: root/ext/bg/js/anki.js
diff options
context:
space:
mode:
authorAlex Yatskov <FooSoft@users.noreply.github.com>2019-08-17 09:05:33 -0700
committerGitHub <noreply@github.com>2019-08-17 09:05:33 -0700
commit8ebac935e8c0ee167514d5726b1e2e16921e4957 (patch)
tree905897bbe19b754597b31b89332e09d45a163c5e /ext/bg/js/anki.js
parent1d25c8a744837b02b5d4364d93df65dd4d0b7ed6 (diff)
parent3a5b06bd1078d39cf9b29cbc05a0cde13c96ca94 (diff)
Merge pull request #182 from toasted-nutbread/anki-screenshot
Anki screenshot
Diffstat (limited to 'ext/bg/js/anki.js')
-rw-r--r--ext/bg/js/anki.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/bg/js/anki.js b/ext/bg/js/anki.js
index 183f37bc..bd4e46cd 100644
--- a/ext/bg/js/anki.js
+++ b/ext/bg/js/anki.js
@@ -58,6 +58,11 @@ class AnkiConnect {
return await this.ankiInvoke('guiBrowse', {query});
}
+ async storeMediaFile(filename, dataBase64) {
+ await this.checkVersion();
+ return await this.ankiInvoke('storeMediaFile', {filename, data: dataBase64});
+ }
+
async checkVersion() {
if (this.remoteVersion < this.localVersion) {
this.remoteVersion = await this.ankiInvoke('version');