Here's the code I currently have:
var clicked = function(){
var selection
chrome.tts.speak(selection, {'lang': 'en-US', 'rate': 0.8, 'enqueue': true});
}
chrome.contextMenus.create({
"title" : "Say '%s'!",
"type" : "normal",
"contexts" : ["selection"],
"onclick" : clicked()
});
I need to get the selection from the current tab. I don't know how to get it. Can anyone help?