I would like to paste a text from the clipboard using javascript, not an extension is a web page.
I tried the document.execCommand('Paste')
command in some ways but it did not work, I'm using Google Chrome.
I would like to paste a text from the clipboard using javascript, not an extension is a web page.
I tried the document.execCommand('Paste')
command in some ways but it did not work, I'm using Google Chrome.
The document.execCommand('Paste')
command can not be run on regular pages only on background pages, which are extension pages.
If you have questions about backgorund pages: link
The document.execCommand('paste')
command has never been a stable JavaScript command. It was a temporary solution designed to help developers program in the Chrome Dev version and apparently is part of the API for Chrome extensions .
She has been removed from Firefox for security reasons and apparently only Cut and Copy work in Chrome, even if they work, the user must have selected part of the page text. The Paste command always returns false
because it can never be executed.