VB6 WebBrowser DISABLE JAVASCRIPT – Code to REMOVE All Javascript Code

This page is going to show you how to remove all JavaScript code from the WebBrowser document. The reason to remove or halt JavaScript in the WebBrowser control is it can seriously slow down and retard the loading of your apps web pages and the app you are creating itself.

How to Disable or Stop Javascript Code in WebBrowser Control

At the start of your application, either Form_Load or UserControl_Show it is a good idea to call the following code to initialize the WebBrowser. Assumption that your WebBrowser control is named [WB].

First click menu Project > References and set reference to the Microsoft Html Object Library.

Then add the following code to the [WB_ProgressChange] event.

If you are looking for how to suppress the script error message box that appears when you visit a website with the WebBrowser control then search this site using the search box for Suppress Script Errors.