Merge branch 'master' into cefsharp/65
This commit is contained in:
commit
cbedc3640f
@ -26,6 +26,7 @@ namespace CefSharp.MinimalExample.WinForms
|
|||||||
};
|
};
|
||||||
toolStripContainer.ContentPanel.Controls.Add(browser);
|
toolStripContainer.ContentPanel.Controls.Add(browser);
|
||||||
|
|
||||||
|
browser.IsBrowserInitializedChanged += OnIsBrowserInitializedChanged;
|
||||||
browser.LoadingStateChanged += OnLoadingStateChanged;
|
browser.LoadingStateChanged += OnLoadingStateChanged;
|
||||||
browser.ConsoleMessage += OnBrowserConsoleMessage;
|
browser.ConsoleMessage += OnBrowserConsoleMessage;
|
||||||
browser.StatusMessage += OnBrowserStatusMessage;
|
browser.StatusMessage += OnBrowserStatusMessage;
|
||||||
@ -37,6 +38,16 @@ namespace CefSharp.MinimalExample.WinForms
|
|||||||
DisplayOutput(version);
|
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)
|
private void OnBrowserConsoleMessage(object sender, ConsoleMessageEventArgs args)
|
||||||
{
|
{
|
||||||
DisplayOutput(string.Format("Line: {0}, Source: {1}, Message: {2}", args.Line, args.Source, args.Message));
|
DisplayOutput(string.Format("Line: {0}, Source: {1}, Message: {2}", args.Line, args.Source, args.Message));
|
||||||
|
@ -22,6 +22,10 @@ namespace CefSharp.MinimalExample.WinForms
|
|||||||
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
|
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.
|
//Perform dependency check to make sure all relevant resources are in our output directory.
|
||||||
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
|
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
|
||||||
|
|
||||||
|
@ -16,6 +16,10 @@ namespace CefSharp.MinimalExample.Wpf
|
|||||||
|
|
||||||
settings.DisableTouchpadAndWheelScrollLatching();
|
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.
|
//Perform dependency check to make sure all relevant resources are in our output directory.
|
||||||
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
|
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user