Replies: 5 comments 5 replies
-
What value does var message = "1+1";
var TRY_JS_MESSAGE_FORMAT = "try {{ {0} }} catch( error ){{ console.log(error) }};";
message = string.Format(TRY_JS_MESSAGE_FORMAT, message);
browser.ExecuteScriptAsync(message); |
Beta Was this translation helpful? Give feedback.
-
Any js function look like below script message=try { _onForeground() } catch( error ){ console.log(error) }; or message=try { if (window.onLoad) onLoad("","en_us","","{"winVersion":10}") } catch( error ){ console.log(error) }; |
Beta Was this translation helpful? Give feedback.
-
Run your script directly in DevTools and see if you get the same behaviour. https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#javascript-debugging Converting to discussion as this is unlikely a bug in CefSharp. Most likely a result of a change in Chromium. |
Beta Was this translation helpful? Give feedback.
-
I use Cefsharp 95 , use this , chromiumWebBrowser1.ExecuteScriptAsync("document.getElementsByTagName('input')[2].click();"); can work. But use Cefsharp 96 don't work it . |
Beta Was this translation helpful? Give feedback.
-
Unfortunately I cannot reopen the original issue so #3944 will now be used to track this issue. |
Beta Was this translation helpful? Give feedback.
-
JS Script working with the cefsharp 95. But after upgraded with cefsharp 96 getting issue with ExecuteScriptAsync when run custom javascript or call the function through native.
What version of the product are you using?
-96.0.180
What architecture x86 or x64?
x86
What version of .Net?
.Net 4.6.1
On what operating system?
Win10
Are you using
WinForms
,WPF
orOffScreen
?WPF
What steps will reproduce the problem?
TRY_JS_MESSAGE_FORMAT = "try {{ {0} }} catch( error ){{ console.log(error) }};";
message = String.Format(TRY_JS_MESSAGE_FORMAT, message);
browser.ExecuteScriptAsync(message);
What is the expected output? What do you see instead?
should not appears error with the javascript and successfully work.
Please provide any additional information below.
Same error with all 96 cefsharp version.
Beta Was this translation helpful? Give feedback.
All reactions