VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Disable webbrowser control script errors

by Karl J. Sak (3 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

Like many people, I've played around with the web browser control and vb. One of things that has always ticked me off is the fact that you can try to cancel popups by using cancel=true in the newwindow2 event. But many times you get a small window showing some kind of script error. I've even tried using ppdisp=webbrowser2.object where webbrowser2.visible=false. No matter what I try I still get the window with a Internet Explorer Script Error. I started to look at the webbrowser.silent property but every time I set it to true it doesn't work. Finally, I know why. You see every time a webbrowser control is run, it automatically sets webbrowser.silent=false. Setting it to true during development doesn't work. What you need to do is run a seperate control. I used a timer control in the form load event, to set the .silent property to true. I then set the timer.enabled=false. The silent property is now set and you won't have to worry about script messages again. So far every web site with popups has been blocked and no script errors. In the source example I also included a way to control popups using the ctrl key.

Rate Disable webbrowser control script errors

Download Disable webbrowser control script errors

Download Disable webbrowser control script errors (2 KB)

Disable webbrowser control script errors Comments

No comments have been posted about Disable webbrowser control script errors. Why not be the first to post a comment about Disable webbrowser control script errors.

Post your comment

Subject:
Message:
0/1000 characters