I\'m using the WPF 3.5SP1 WebBrowser control to display a page containing some javascript functions. My program then needs to invoke a javascript function which will make an
See related question: Can you wait for javascript callback?
Quoting from a quote in my answer to that question:
JavaScript Strands adds coroutine and cooperative threading support to the JavaScript language to enable blocking capabilities for asynchronous event callbacks.
And more:
Narrative JavaScript is a small extension to the JavaScript language that enables blocking capabilities for asynchronous event callbacks. This makes asynchronous code refreshingly readable and comprehensible.
Although making normally asynchronous code behave as synchronous is technically possible, I would recommend that you reconsider your design to go with an asynchronous approach.