|
-
Jun 26th, 2013, 05:59 PM
#12
Member
Re: [RESOLVED] Help With Kleinma's Suppressing Javascript Alerts in WebBrowser
I'd like to share an interesting result of some simple modifications to Kleinma's brilliant original. This is what I did:
1) I increased tmrPopCheck.Interval from 100 to 1000;
2) I suppressed the line "tmrPopCheck.Stop()" at the Sub "tmrPopCheck_Tick";
3) I replaced the line "If (PopupHandle <> IntPtr.Zero) AndAlso (PopupHandle <> WB.Handle) Then" by "If (PopupHandle <> IntPtr.Zero) AndAlso (PopupHandle <> WB.Handle) AndAlso (PopupHandle <> Me.Handle) Then".
By doing this, every JSAlert (both "onload" and "onclick") is now promptly killed, and the form is not closed.
I have also a question:
What if my page has a JS Confirm pop-up (with OK and Cancel buttons) instead of a simple Alert? How could I give it one or other of these answers programatically? Is that possible?
Thank you very much!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|