File chooser dialog can only be shown with a user activation. #3710
phoducgiang
started this conversation in
General
Replies: 1 comment 17 replies
-
For security reasons you cannot trigger a file dialog through JavaScript without user action. You can focus the button and send through an enter key press. https://stackoverflow.com/questions/44736904/issue-with-cefsharp-browser-sendkeys |
Beta Was this translation helpful? Give feedback.
17 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have to embedded cefsharp to my winforms tools. However i cannot run the js script for click to show dialog box then choose the file for upload. Cefsharp always show the log "File chooser dialog can only be shown with a user activation.", please advise me how to fix this issue.
Here is my js script:
function performClick(elemId) { var elem = document.getElementsByName(elemId)[0]; if(elem && document.createEvent) { var evt = document.createEvent("MouseEvents"); evt.initEvent("click", true, false); elem.dispatchEvent(evt); } } performClick("tabSearch$TabPanel1$fileSearchTemplate");
Beta Was this translation helpful? Give feedback.
All reactions