Re: Removing alerts from WebBrowser control
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 17 Mar 2007 20:58:59 -0400
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]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Sin Jeong-hun" <typingcat@xxxxxxxxx> wrote in message
news:1174067310.168528.164490@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?
.
- References:
- Removing alerts from WebBrowser control
- From: Sin Jeong-hun
- Removing alerts from WebBrowser control
- Prev by Date: Re: LINQ in C#
- Next by Date: Re: Accessing SSL secured web sites from C# application.
- Previous by thread: Removing alerts from WebBrowser control
- Next by thread: System.IO.Ports.SerialPort
- Index(es):
Relevant Pages
|