/// <summary> /// Initialise the WebView control /// </summary> private void InitialiseWebView() { // Disable caching. BrowserSettings settings = new BrowserSettings(); settings.ApplicationCacheDisabled = true; settings.PageCacheDisabled = true; // Initialise the WebView. this.webView = new WebView(string.Empty, settings); this.WebView.Name = string.Format("{0}WebBrowser", this.Name); this.WebView.Dock = DockStyle.Fill; // Setup and regsiter the marshal for the WebView. this.chromiumMarshal = new ChromiumMarshal(new Action(() => { this.FlushQueuedMessages(); this.initialising = false; }), this); this.WebView.RegisterJsObject("marshal", this.chromiumMarshal); // Setup the event handlers for the WebView. this.WebView.PropertyChanged += this.WebView_PropertyChanged; this.WebView.PreviewKeyDown += new PreviewKeyDownEventHandler(this.WebView_PreviewKeyDown); this.Controls.Add(this.WebView); }