aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/bg/js/api.js2
-rw-r--r--ext/fg/js/api.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index c33ba709..4b2bacd7 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -64,7 +64,7 @@ async function apiDefinitionAdd(definition, mode, context) {
);
}
- if (context.screenshot) {
+ if (context && context.screenshot) {
await apiInjectScreenshot(
definition,
options.anki.terms.fields,
diff --git a/ext/fg/js/api.js b/ext/fg/js/api.js
index 0c86b412..99ad307c 100644
--- a/ext/fg/js/api.js
+++ b/ext/fg/js/api.js
@@ -49,6 +49,10 @@ function apiTemplateRender(template, data, dynamic) {
return utilInvoke('templateRender', {data, template, dynamic});
}
+function apiAudioGetUrl(definition, source) {
+ return utilInvoke('audioGetUrl', {definition, source});
+}
+
function apiCommandExec(command) {
return utilInvoke('commandExec', {command});
}