I want to modify the user's clipboard when he presses CTRL+C based on what the server responds. The communication with the server is done through a web socket. I managed to get the oncopy event and I'm able to set some content to it, but only immediately. What I want is something like this:
- oncopy event fired and caught
- ask the server for something (socket.send(bla bla))
- receive answer from the server (socket.onmessage())
- update the user's clipboard by editing event.clipboardData
Is it possible?
Or is there a way in which I could do busy waiting in the event handling method while the message from the server is being received?