I would like to know how to call a function once the user double-clicks on any word on the page they are visiting (from a content script). Something similar to Google Dictio
I suspect Google adds an EventListener to the page to register a double click, and then gets the text that was automatically selected.
http://developer.mozilla.org/en/DOM/element.addEventListener
http://developer.mozilla.org/en/DOM/window.getSelection
f=function(){
console.log(window.getSelection().toString());
}
document.body.addEventListener('dblclick',f);