-
Need help blocking web sites with webbrowser control
I am writing a VB6 program for my grandchildren where the click of a command button displays a web site in a webbrowser control. Everything is working well, but I want to block any attempt to link to other web sites. For example, if the child clicks the button to go to a web site with childrens games, it would be OK to click a link WITHIN that web site, but not OK to click on a link that would send the browser to, say, an advertisement leading to an outside web site. I tried the BeforeNavigate events, but they seem to fire too late, because the new website in the control is half displayed before I get a chance to do a webbrowser.stop; and if I try to do a webbrowser.goback, the program goes into a nasty loop. Any suggestions would be appreciated. Thanks, Ron E.
-
I don't know if it's possible to prevent a WebBrowser control from following a hyperlink. Instead, you might try using an Internet Transfer Control to download the HTML source of the page you want to display, then go through the HTML programmatically and remove any links to sites outside the page's domain. Finally, display the sanitized HTML in the WebBrowser control.
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Similar Threads
-
Replies: 0
Last Post: 03-26-2003, 02:17 PM
-
By Constance J. Petersen in forum .NET
Replies: 13
Last Post: 08-28-2002, 10:06 PM
-
By Robin in forum VB Classic
Replies: 1
Last Post: 02-05-2002, 12:53 AM
-
By FLD in forum Enterprise
Replies: 2
Last Post: 11-20-2000, 11:34 AM
-
By Rick Burden in forum Enterprise
Replies: 0
Last Post: 07-22-2000, 10:29 PM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks