diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-08-15 19:39:58 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-08-15 19:39:58 -0400 |
commit | 0f0adf750c8cde668cdcf369cbe0ac173a9edf3f (patch) | |
tree | ac33e7efb308f06444a18feb535aab7fba6fd45f /ext/bg/js/anki.js | |
parent | e23d4b9a82581f3cf1118e31d077fc9cdaff7573 (diff) |
Add ability to save screenshot to anki cards
Diffstat (limited to 'ext/bg/js/anki.js')
-rw-r--r-- | ext/bg/js/anki.js | 5 |
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'); |