Merge branch 'master' into cefsharp/65

This commit is contained in:
Alex Maitland 2018-07-13 21:26:07 +10:00 committed by GitHub
commit cbedc3640f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -26,6 +26,7 @@ namespace CefSharp.MinimalExample.WinForms
};
toolStripContainer.ContentPanel.Controls.Add(browser);
browser.IsBrowserInitializedChanged += OnIsBrowserInitializedChanged;
browser.LoadingStateChanged += OnLoadingStateChanged;
browser.ConsoleMessage += OnBrowserConsoleMessage;
browser.StatusMessage += OnBrowserStatusMessage;
@ -37,6 +38,16 @@ namespace CefSharp.MinimalExample.WinForms
DisplayOutput(version);
}
private void OnIsBrowserInitializedChanged(object sender, IsBrowserInitializedChangedEventArgs e)
{
if(e.IsBrowserInitialized)
{
var b = ((ChromiumWebBrowser)sender);
this.InvokeOnUiThreadIfRequired(() => b.Focus());
}
}
private void OnBrowserConsoleMessage(object sender, ConsoleMessageEventArgs args)
{
DisplayOutput(string.Format("Line: {0}, Source: {1}, Message: {2}", args.Line, args.Source, args.Message));

View File

@ -22,6 +22,10 @@ namespace CefSharp.MinimalExample.WinForms
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
};
//Example of setting a command line argument
//Enables WebRTC
settings.CefCommandLineArgs.Add("enable-media-stream", "1");
//Perform dependency check to make sure all relevant resources are in our output directory.
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);

View File

@ -15,6 +15,10 @@ namespace CefSharp.MinimalExample.Wpf
};
settings.DisableTouchpadAndWheelScrollLatching();
//Example of setting a command line argument
//Enables WebRTC
settings.CefCommandLineArgs.Add("enable-media-stream", "1");
//Perform dependency check to make sure all relevant resources are in our output directory.
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);