1
Is there any way to simulate a Ctrl+v using Javascript?
I want to include a button and an input. When clicking the button, whatever is in the clipboard should appear in the input.
The code is for an HTML page that shortens links. It has only two fields: URL and link name.
My idea is that the user copy the URL and when accessing the page, click the button to paste the content in the input.
Would it be on a web page or are you developing an extension for browsers? If it is web page, I would like to know the motivation of this need, seems to me something that can be solved otherwise depending on the need.
– Guilherme Nascimento
I explained more details in the question
– Italo Rodrigo
It wouldn’t be easier to send the link via GET or POST to the other page?
– Guilherme Nascimento
In case it comes from a page of your domino, send to url via request is a good idea.
– Lucas Henrique
In this case, imagine that you are browsing here in the OS and want to send the link to someone. Then you copy the link, go to the shorten URL site and click on the button to paste it there. That’s the idea. So it can’t be via get
– Italo Rodrigo
I said via GET if the shortener is an internal tool, if it’s any web site you can easily resolve using the provided Apis, just like twitter automatically does when you paste a link, the moment you post it converts your link to a short link, just follow the same "recipe".
– Guilherme Nascimento