0
在我的Thunderbird插件PasteHyperlink中,我有一个插入HTML元素到Message Compose窗口的例程。insertElementAtSelection停止工作
这用在雷鸟的工作,但现在我得到这个js错误:
Error: TypeError: thiseditor.insertElementAtSelection is not a function
然而,似乎thiseditor
被定义的,因为它不启动警报。
下面是函数的代码,我已经减少到基本功能:
var thiseditor = gMsgCompose.editor;
if (!thiseditor){ alert("Dude, the gMsgCompose.editor is broken") };
let link = thiseditor.document.createElement("a");
link.setAttribute("href", "http://stackoverflow.com");
link.textContent = "Display Text";
thiseditor.insertElementAtSelection(link, false);
MDN has this documentation,但我不能在任何地方找到任何关于为什么这是损坏或发动机罩下的是什么改变了会谈雷鸟45.
为什么这退出工作,我应该怎么做呢?