Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2004, 12:22 PM
Registered User
 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Silent SHDocVw.InternetExplorer

I have a service that uses an invisible web browser to simulate users visiting websites, clicking links, filling in data and submitting buttons. It somehow works.

The problem is that this needs to be completely automatic, there's noone who'd click off the JavaScript alerts, popups and other trash. You might think that there's an option to the InternetExplorer object you could set to prevent them, but ... well if there is I did not find it.
I can prevent the popups from within the NewWindow2 event, but the only way I found to prevent alert()s, confirm()s and other JavaScript functions from ruinging everything is to overwrite their implementation by inserting something like
<script>
function window.alert(msg) {...}
...
</script>
into the page in the DocumentComplete even handler. This works fine for the alerts called from onClick and other JavaScript handlers, it's even soon enough for those called from <body onLoad="HERE">, but if the page contains
<script>
alert("Gotcha!");
</script>
the message gets displayed before the DocumentComplete event triggers and the program times out waiting for page completion. And even worse the browser then refuses to quit. Which means that the program starts to accumulate browsers waiting for the nonexistant user to click the invisibe messagebox. And that the per-session cookies are not forgotten after each task, which causes the sites to think I'm already logged in and the scripts fail.

So does anyone have any idea how to prevent that (censored) invisible messagebox?

Thanks a lot, Jenda
P.S.: The sites do know we are doing this to them!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Silent Downloader HELP!!!!! prog_host_1 Beginning VB 6 1 May 17th, 2007 08:17 PM
How do I obtain a SHDocVw.InternetExplorer cschene VB.NET 2 December 8th, 2006 07:29 PM
Controlling InternetExplorer jamie_t VB How-To 2 March 15th, 2005 07:22 AM
SHDOCVW giving error on compiled run WarriorKing Pro VB 6 3 December 20th, 2004 12:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.