With Nightly and FF 57.04 It seems that the command
document.execCommand("paste");
is not working on same page:
area = document.createElement("textarea");
area.setAttribute("id", "fcb_txt_area");
if (field) {
field.parentNode.append(area);
}
else {
document.body.appendChild(area);
}
area.contentEditable = true;
area.textContent = '';
area.select();
console.log('Pre-paste: ' + area.value);
document.execCommand("paste");
var value = area.value;
console.log('Post-paste: ' + area.value);
return value;
On these page the Post-paste value is empty.
Strangely it is not consistent: when I load a page the it does not work but it seems that if I run a
document.execCommand('copy', false, null);
on the same page using my extension without reloading, then the paste command succeed …
Any idea someone ?
Thanks
F