summaryrefslogtreecommitdiff
path: root/ext/fg/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/util.js')
-rw-r--r--ext/fg/js/util.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js
index 176765fc..c24ad885 100644
--- a/ext/fg/js/util.js
+++ b/ext/fg/js/util.js
@@ -17,28 +17,28 @@
*/
-function sendMessage(action, params) {
+function invokeApiBg(action, params) {
return new Promise((resolve, reject) => chrome.runtime.sendMessage({action, params}, resolve));
}
function findTerm(text) {
- return sendMessage('findTerm', {text});
+ return invokeApiBg('findTerm', {text});
}
function findKanji(text) {
- return sendMessage('findKanji', {text});
+ return invokeApiBg('findKanji', {text});
}
function renderText(data, template) {
- return sendMessage('renderText', {data, template});
+ return invokeApiBg('renderText', {data, template});
}
function canAddDefinitions(definitions, modes) {
- return sendMessage('canAddDefinitions', {definitions, modes});
+ return invokeApiBg('canAddDefinitions', {definitions, modes});
}
function addDefinition(definition, mode) {
- return sendMessage('addDefinition', {definition, mode});
+ return invokeApiBg('addDefinition', {definition, mode});
}
function textSourceFromPoint(point) {