By default, each Browser instance stores all user data such as history, cookies, cache on disk. Since 1.14 you can configure Browser instance to store all user data in memory (Chromium's "Incognito" mode), so that all user data will be cleared once your .Net application is terminated.


The following example demonstrates how to configure Browser instance to work in "Incognito" mode and store all user data in memory:

C#

using System.Windows.Forms;
using DotNetBrowser;
using DotNetBrowser.WinForms;

namespace WindowsFormsApplication9
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            BrowserContextParams parameters = new BrowserContextParams("data-dir") { StorageType = StorageType.MEMORY };
            BrowserContext context = new BrowserContext(parameters);
            Browser browser = BrowserFactory.Create(context);
            WinFormsBrowserView browserView = new WinFormsBrowserView(browser);
            browser.LoadURL("teamdev.com");

            Controls.Add(browserView);
        }
    }
}

VB.NET

Imports DotNetBrowser
Imports DotNetBrowser.WinForms

Public Class Form1

    Sub New()
        InitializeComponent()
        Dim parameters As BrowserContextParams = New BrowserContextParams("data-dir") With {.StorageType = StorageType.MEMORY}
        Dim context As BrowserContext = New BrowserContext(parameters)
        Dim browser As Browser = BrowserFactory.Create(context)
        Dim browserView As WinFormsBrowserView = New WinFormsBrowserView(browser)
        browser.LoadURL("teamdev.com")

        Controls.Add(browserView)
    End Sub
End Class