I am building an app that uses clipboard functionality.
One of the functionalities of the clipboard, is that when the user copies text from within the browser, I want to fetch the url of the page the text was copied from.
I do this by using robotjs, and simulating the
Command+L and then Command+C
This successfully copies the URL to the OS keyboard (I have checked with Command+V), but when I try to read it via the electron clipboard, I get a blank string, as if nothing was copied.
** I have tried this with removing the
clipboard.clear(), and still get the same result.
I have been stuck on this for several days, and would be glad if someone could point me in the right direction.