From 62a47278b5f5751ceaac18a26659c794fbc0ed84 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 23 Mar 2016 19:41:13 -0700 Subject: [PATCH] WIP --- ext/content.js | 2 +- ext/jp/init.js | 2 +- ext/util.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/content.js b/ext/content.js index c36b7381..5ff0031e 100644 --- a/ext/content.js +++ b/ext/content.js @@ -37,7 +37,7 @@ function getRangeAtCursor(e, lookAhead) { function onMouseDown(e) { - e.preventDefault(); + // e.preventDefault(); const range = getRangeAtCursor(e, 20); if (range === null) { diff --git a/ext/jp/init.js b/ext/jp/init.js index 81c06d3d..d3345a38 100644 --- a/ext/jp/init.js +++ b/ext/jp/init.js @@ -33,7 +33,7 @@ const trans = new Translator(res, onInit); function onMessage(request, sender, callback) { switch (request.action.toLowerCase()) { case 'define': - callback(trans.findTerm(request.term)); + callback(trans.findTerm(request.text)); break; } } diff --git a/ext/util.js b/ext/util.js index 8523fe22..0b92cde0 100644 --- a/ext/util.js +++ b/ext/util.js @@ -18,5 +18,5 @@ function findTerm(text, callback) { - chrome.runtime.sendMessage({action: 'define', text: text}, callback); + window.chrome.runtime.sendMessage({action: 'define', text: text}, callback); }