I'm developing a Firefox extension using Firefox addon-sdk. One of my content scripts is trying to insert some text into an editable div by using this standard javascript function:
document.execCommand("InsertHTML", false, 'test text');
The above code works perfectly in my Chrome extension but fails in Firefox with this error:
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" data: no]
Is there any other solution to insert text at the current position into an editable div(in a content script).
Thanks in advance