Hi Everyone,
I am trying to migrate my app from CEF to the new Webview2 control.
I could manage to navigate to the desired html, load its javascript, register a PB user event, trigger the user event from Javascript and call EvaluateJavascriptAsync from PB. The only missing step for me is calling EvaluateJavascriptSync from PB (outside the registered event !), which actually immediately kills the IDE and the debugger.
Code like below seamlessly worked in CEF:
string js_command, js_result, js_error
int ret
ret = wb_1.EvaluateJavascriptSync('js_function("params");', ref js_result, ref js_error)
ret = wb_1.EvaluateJavascriptSync('javascript:js_function("params");', ref js_result, ref js_error)
At such places the async function works, but it would be much more convenient to use the sync one (e.g. for error checking).
Does any of you have gone through a similar exercise?
What are the constraints for using the sync function? Can you use it in the new control anyway?
Any help would be highly appreciated.
András Balázs
I feel much better now. :-)
András