I'm trying to paste clipboard data into a textarea using execcommand("paste")
with a chome extension, but i cannot seem to get it to work.
permissions are set.
I have tried to set focus()
on the textarea, but document.execCommand("paste")
does nothing, and I get no error.
calling execcommand("paste")
from background page also does nothing.
<form>
<textarea id="ta"></textarea>
</form>
<script type="text/javascript">
document.findElemetById("ta").focus();
document.execCommand("paste");
</script>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…