CefSharp icon indicating copy to clipboard operation
CefSharp copied to clipboard

ExecuteScriptAsync stuck?

Open microwishing opened this issue 11 years ago • 6 comments

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!

microwishing avatar Feb 17 '15 01:02 microwishing

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 avatar Feb 17 '15 01:02 amaitland

amaitland, thanks! I just updated the description. please help take a look. thanks

microwishing avatar Feb 17 '15 19:02 microwishing

What thread are you executing ExecuteScriptAsync on? Your code out of context doesn't provide a lot of information.

amaitland avatar Feb 18 '15 02:02 amaitland

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 ...

pipiscrew avatar Feb 24 '15 09:02 pipiscrew

@microwishing Any further comment? Can we close this?

You might find #868 useful.

amaitland avatar Mar 18 '15 11:03 amaitland

Closing this due to lack of feedback. Reopen if required.

amaitland avatar Mar 23 '15 23:03 amaitland