Sin Jeong-hun,
How are you loading the HTML? Are you dynamically generating it or are
you loading it from the web/a file.
If you are loading it from a file, I would modify the contents of the
file before you load it.
If you are loading it from the web, then I would download the content
into a MemoryStream first and then modify the contents of the file, then
passing it to the DocumentStream property of the WebBrowser control.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Sin Jeong-hun" <ty*******@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.com...
Is it possible to modify the HTML or the script of a WebBrowser
control in DocumentCompleted event? I tried to modify it but that
caused DocumentCompleted again so the program fell in an endless loop.
The reason I'm trying to do so is to remove some specific scripts like
"alert()" because it locks up the WebBrowser control. When there's an
alert box is open, calling Navigate causes an exception. I need other
scripts to be executed so I cannot turn the entier Javascript off.
So in short, how can I modify the html in DocumentComplete event
before alert() is executed?