WIP
This commit is contained in:
parent
2fe2e993ee
commit
62a47278b5
@ -37,7 +37,7 @@ function getRangeAtCursor(e, lookAhead) {
|
||||
|
||||
|
||||
function onMouseDown(e) {
|
||||
e.preventDefault();
|
||||
// e.preventDefault();
|
||||
|
||||
const range = getRangeAtCursor(e, 20);
|
||||
if (range === null) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user