Kast2k Posted May 3, 2020 Share Posted May 3, 2020 Dear colleagues, I created a demo of receiving screenshot from clipboard (attached), but it works only if you are pressing Ctrl+V. If i add this code on Button click then no result. UniSession.AddJS( 'document.execCommand(''paste'');' ); Could you please show what am i doing wrong? How can i simulate Ctrl+V combination? Thank You. UniGUIClipboardImage.zip Quote Link to comment Share on other sites More sharing options...
Kast2k Posted May 5, 2020 Author Share Posted May 5, 2020 Not actual any more Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted May 26, 2021 Share Posted May 26, 2021 ???? any solution??? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted May 26, 2021 Share Posted May 26, 2021 https://stackoverflow.com/a/53448633/2176869 Calling document.execCommand("paste") is not supported by "reasonable" browsers, because of security concerns as it might enable the script to read sensitive data (like passwords) from the clipboard. This is the compatibility matrix of document.execCommand("...") concerning clipboard events: "copy" "paste" "cut" IE OK OK n/a Edge OK n/a OK Firefox OK n/a OK Chrome OK n/a OK Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted May 26, 2021 Share Posted May 26, 2021 What is the solution to this? I want to click on a button to apply CTR + V, But Clipboard does not work on the client only on the server procedure TUniNF.UniButton1Click (Sender: TObject); begin Uniedit1.text: = Clipboard.AsText; end; Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted May 26, 2021 Share Posted May 26, 2021 1 hour ago, Daha Software said: What is the solution to this? I want to click on a button to apply CTR + V, But Clipboard does not work on the client only on the server procedure TUniNF.UniButton1Click (Sender: TObject); begin Uniedit1.text: = Clipboard.AsText; end; Due to security reasons,the browsers are not letting you document.execCommand("paste") There is no solution Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.