Waiting for WebBrowser ajax content

前端 未结 4 1286
感动是毒
感动是毒 2021-02-14 14:21

I want to pause the execution of my thread until a particular div has been loaded via ajax into a WebBrowser instance. Obviously I can continuously check for the presence of thi

4条回答
  •  粉色の甜心
    2021-02-14 14:42

    Don't block the main thread's message pump. Since the browser is an STA component, xmlhttprequest won't be able to raise events from the background thread if you block the message pump. You can't navigate in a background thread. The Windows Forms wrapper of the webbrowser ActiveX does not support access from other threads than the UI thread. Use a timer instead.

提交回复
热议问题