Note: Advice in this article will only work for DotNetBrowser 1.
See the corresponding article for DotNetBrowser 2 here.

DotNetBrowser provides functionality that allows you to enable or disable various features, such as images, JavaScript, videos, etc., for each Browser instance. Use the BrowserPreferencesclass to work with Browserfeatures/preferences. To modify some features/preferences you need to obtain BrowserPreferencesinstance using the BrowserPreferencesproperty, modify preferences, and save them by setting the same property.

The following sample code demonstrates how to disable loading images and JavaScript execution on web page:


Browser browser = BrowserFactory.Create();

// Gets the current Browser's preferences
BrowserPreferences preferences = browser.Preferences;
preferences.ImagesEnabled = false;
preferences.JavaScriptEnabled = false;

// Updates Browser's preferences
browser.Preferences = preferences;

// Images and JavaScript will be disabled


Dim browser As Browser = BrowserFactory.Create()

' Gets the current Browser's preferences
Dim preferences As BrowserPreferences = browser.Preferences
preferences.ImagesEnabled = False
preferences.JavaScriptEnabled = False

' Updates Browser's preferences
browser.Preferences = preferences

' Images and JavaScript will be disabled