1

I have a problem when using the web-browser control in my application (C#, framework 3.5), every now and then IE finds a html page that will cause it to hang, freezing my whole application.

Such as this little gem

<html><head>
<style type="text/css">
#a {
        margin:0 10px 10px;
}

#b {
        width:100%;
}

</style>
<title>IE Crasher</title>
</head>
<body>
<table><tr><td>
<div id="a">
<form id="b">
<input type="text" name="test"/>
</div>
</td><td width="1"></td></tr></table>
</body></html>

Given that I shall never be able to vouch for the stability of IE or any browser for that matter, is there a way to handle such a freeze, without it shivving my main app in the jugular.

I've tinkered with Gecko and XULRunner, looks nice, but swapping out browser controls does not really solve the problem, it is still possible Firefox could hang. Alternatively I tried AxBrowser to see if there was any difference, tried calling it from another thread but I knew that wouldnt do anything ..

No, what I'd like to be able to do is if IE-as-Browser-control decides its going to have a little sleep I'd really like to have the option of the user simply closing down the container its in.

Not sure where to start, protecting my app from rogue third-party controls.

Kara
  • 6,115
  • 16
  • 50
  • 57
snark
  • 27
  • 1
  • 6
  • http://mikemccabe.wordpress.com/2007/04/14/running-ie-from-c-in-a-separate-process/ – Hans Passant May 10 '12 at 01:43
  • I read that but the end result was running in a separate window. I hope to still house it in my slide out panel .. – snark May 10 '12 at 01:57
  • have you tried to load the WebBrowser control in a separate AppDomain – volody May 10 '12 at 19:36
  • Nope, but that does look a like a good contender .. I shall start digging in that direction right now .. – snark May 10 '12 at 23:48
  • it can be related http://stackoverflow.com/questions/904478/how-to-fix-the-memory-leak-in-ie-webbrowser-control – walter May 11 '12 at 01:32

0 Answers0