Need to get selected text as a string from the current tab

Discussion in 'JavaScript Forum' started by BEGESSDULSE, Apr 10, 2013.


    BEGESSDULSE New Member

    Here's the code I currently have:\[code\]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()});\[/code\]I need to get the selection from the current tab. I don't know how to get it.Can anyone help?

Share This Page