在Firefox中未定义window.getSelection()

时间:2019-07-02 20:44:52

标签: javascript firefox firefox-addon

我正在扩展Firefox(在新标签中的Wiktionary上打开突出显示的单词的定义)。我迷上了文本选择部分:推荐的window.getSelection()。toString()无法工作,因为window.getSelection()未定义。

我尝试过的事情:

JavaScript / jQuery: how to get selected text in Firefox(也未定义)

JavaScript / jQuery: get selection function not working in Firefox and Chrome(两个分支都不起作用)

window.getSelection() of textarea not working in firefox?(实际上返回字符串“ undefined”)

window.getSelection returning undefined or null(仅适用于Chrome)

Get the Highlighted/Selected text(仅镀铬或未重新定义)

0 个答案:

没有答案