diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-03-24 20:56:47 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-03-24 20:56:47 -0700 |
commit | 059b2eb4f229f9669709520a5c88d041b3b64590 (patch) | |
tree | 9f53547aa6dd0ade22372dfc9f6c1298087a04b7 /ext/api.js | |
parent | ac012b26b37f6c01a80c1faa98fbe43913e47b6e (diff) |
Improved messaging
Diffstat (limited to 'ext/api.js')
-rw-r--r-- | ext/api.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -17,6 +17,10 @@ */ +function sendMessage(action, data, callback) { + window.chrome.runtime.sendMessage({action: action, data: data}, callback); +} + function findTerm(text, callback) { - window.chrome.runtime.sendMessage({action: 'define', text: text}, callback); + sendMessage('findTerm', {term: text}, callback); } |