aboutsummaryrefslogtreecommitdiff
path: root/ext/jp/api.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-03-25 20:54:04 -0700
committerAlex Yatskov <alex@foosoft.net>2016-03-25 20:54:04 -0700
commita1bab38a2dafcbf0657ea3e653980cc053006ce7 (patch)
treed7d7002140204a18a07a14780a1b1b561cca11df /ext/jp/api.js
parent059b2eb4f229f9669709520a5c88d041b3b64590 (diff)
Deinflection fixes
Diffstat (limited to 'ext/jp/api.js')
-rw-r--r--ext/jp/api.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/jp/api.js b/ext/jp/api.js
index 95c2f7e3..216b961f 100644
--- a/ext/jp/api.js
+++ b/ext/jp/api.js
@@ -36,6 +36,13 @@ function onMessage(request, sender, callback) {
}
}
+function onInit() {
+ chrome.runtime.onMessage.addListener(onMessage);
+
+ const res1 = window.trans.findTerm('食べられない');
+ const res2 = window.trans.findTerm('作られている');
+}
+
(() => {
const res = {
rules: 'jp/data/rules.json',
@@ -44,8 +51,5 @@ function onMessage(request, sender, callback) {
kanjidic: 'jp/data/kanjidic.json'
};
- window.trans = new Translator(
- res,
- () => chrome.runtime.onMessage.addListener(onMessage)
- );
+ window.trans = new Translator(res, onInit);
})();