ExecuteScriptAsync stuck?
Hi,
We have been working to add progress bar in our product. Our backend is using C++. The backend has a loop to do a specific operation. In the loop, it calls frontend javascript object to update the progress bar through ExecuteScriptAsync. However, we notice the progress bar isn't showing up when loop continues. It seems ExecuteScriptAsync requests are stuck somehow. After the loop completes, the progress bar shows up and animates as expected. We added sleep(10000) after ExecuteScriptAsync call, the progress bar still doesn't show up. Is there anyone knowing what is going on?
The source code is like below:
int progress = 0; // 0 to 100
for (int i = 0; i < 5; i ++) { progress += 20; wb->ExecuteScriptAsync("progressbar.UpdateProgress(" + progress + ")"); // sleep(10000) }
Environment: Windows 2008, WinForms, CefSharp3 libraries built from the latest main branch.
thanks!
Version? WinForms, WPF? Sample code as a GIST.....need more information please.
There's a bug template here that's available as part of https://github.com/cefsharp/CefSharp/blob/master/CONTRIBUTING.md#what-should-i-include-when-creating-an-issue
amaitland, thanks! I just updated the description. please help take a look. thanks
What thread are you executing ExecuteScriptAsync on? Your code out of context doesn't provide a lot of information.
try implement http://stackoverflow.com/a/1415103
or as second solution, you will have already at your javascript in browser a function aka function setProgress(perc) { progressbar.value=perc }
and keep call that function from ExecuteScriptAsync ...
@microwishing Any further comment? Can we close this?
You might find #868 useful.
Closing this due to lack of feedback. Reopen if required.