CefSharp icon indicating copy to clipboard operation
CefSharp copied to clipboard

Feature Request - Add EvaluateScriptAsync CancellationToken overload

Open rLindorfer opened this issue 5 years ago • 1 comments

Currently it is not possible to specify a CancellationToken for canceling the EvaluateScriptAsync task. Therefore, when executing a long-running javascript method it is not possible to cancel it.

Describe the solution you'd like: Extend the WebBrowserExtensions.EvaluateScriptAsync() method with the possibility to specifiy a CancellationToken.

rLindorfer avatar Apr 16 '20 12:04 rLindorfer

Therefore, when executing a long-running javascript method it is not possible to cancel it.

Adding an overload with a CancellationToken wouldn't actually allow for cancellation of running Javascript, it would just cancel the Task and the result would be ignored.

JavaScript is executed in a separate Render process that only has a single thread. The CEF API doesn't allow for cancellation.

amaitland avatar Apr 16 '20 21:04 amaitland