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.
爲什麼這退出工作,我應該怎麼做呢?