-
Notifications
You must be signed in to change notification settings - Fork 5
Embedded Browser
MIkE edited this page Nov 17, 2017
·
26 revisions
- Cef - Chromium Embedded Framework (Aardvark Platforms Default)
- Gecko - Browser Engine used in Firefox until FF 57
- Quantum - Browser Engine used in Firefox 57 and forward (based on Servo)
- WebKit - Browser Engine used in Apples Safari
- KHTML - Browser Engine used in KDEs Konqueror (Ancestor of WebKit, Chromium, Opera,...)
- EdgeHTML/WebView - UWP Edge Browser Control, Win10 only, not tested with Aardvark Platform
- WebBrowser - Winforms Internet Explorer Control, doesn't work with Aardvark Platform
NuGet packages:
32bit: Geckofx45
64bit: Geckofx45.64
Gecko.Xpcom.Initialize("Firefox");
var browser = new Gecko.GeckoWebBrowser() {
Dock = DockStyle.Fill,
Navigate("http://orf.at")
}
DPS destroys and recreates its Forms. As a result Chromium crashes and Gecko refuses to show anything.
Fix: Detach and reattach browser control
class MyForm : WeifenLuo.WinFormsUI.Docking.DockContent
...
myForm.DockStateChanged += new EventHandler(DockedBrowser_DockStateChanged);
myForm.HandleDestroyed += new EventHandler(DockedBrowser_HandleDestroyed);
...
void DockedBrowser_HandleDestroyed(object sender, EventArgs e) {
m_myBrowserCtrl.Parent = null;
}
void DockedBrowser_DockStateChanged(object sender, EventArgs e) {
if (IsHandleCreated) {
m_myBrowserCtrl.Parent = FindForm()
m_myBrowserCtrl.BringToFront();
}
}
CefRuntime starts the current executable several times to initiate its child processes. The VS hosting process breaks this.
There are two solutions to fix this:
- Disable "Visual Studio hosting process" in the projects properties under Debug
- Use a different executable to start the child process and oppress CrashPad