TOGOUTECH

commandDispatcher

全部标签

javascript - Firefox 扩展 : Get selected text

我正在开发一个简单的Firefox扩展,我想获取选定的文本。我试过这个:varWordCount={/*...*/changeSelected:function(){varselectedText=this.getSelection();varwords=this.countWords(selectedText);this.changeStatus(words,"selected");//alert(selectedText);},getSelection:function(e){varfocused_window=document.commandDispatcher.