summaryrefslogtreecommitdiff
path: root/ext/jp/init.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-03-23 20:39:21 -0700
committerAlex Yatskov <alex@foosoft.net>2016-03-23 20:39:21 -0700
commit14f855ee75c6c95ac1c6c3f3b655dd0ae8c0e7ff (patch)
tree5260063e3603ebecb8e538e8a6007dd58e158ef7 /ext/jp/init.js
parent62a47278b5f5751ceaac18a26659c794fbc0ed84 (diff)
Tests
Diffstat (limited to 'ext/jp/init.js')
-rw-r--r--ext/jp/init.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/jp/init.js b/ext/jp/init.js
index d3345a38..56ec8b34 100644
--- a/ext/jp/init.js
+++ b/ext/jp/init.js
@@ -18,6 +18,7 @@
function onInit() {
+ const test = trans.findTerm('食べられない');
chrome.runtime.onMessage.addListener(onMessage);
}
@@ -28,12 +29,12 @@ const res = {
kanjidic: 'jp/data/kanjidic.json'
};
-const trans = new Translator(res, onInit);
+window.trans = new Translator(res, onInit);
function onMessage(request, sender, callback) {
switch (request.action.toLowerCase()) {
case 'define':
- callback(trans.findTerm(request.text));
+ callback(window.trans.findTerm(request.text));
break;
}
}