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