static void StartDebugServer()
{
GeckoPreferences.User["devtools.debugger.remote-enabled"] = true;
// It seems these files MUST be in a subdirectory of the application directory. At least, I haven't figured out
// how it can be anywhere else. Therefore the build copies the necessary files there.
// If you try to change it, be aware that the chrome.manifest file contains the name of the parent folder;
// if you rename the folder and don't change the name there, you get navigation errors in the code below and
// remote debugging doesn't work.
var chromeDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "remoteDebugging");
registerChromeDir(chromeDir);
_debugServerStarter = new GeckoWebBrowser();
_debugServerStarter.NavigationError += (s, e) => {
Console.WriteLine(">>>StartDebugServer error: " + e.ErrorCode.ToString("X"));
_debugServerStarter.Dispose();
_debugServerStarter = null;
};
_debugServerStarter.DocumentCompleted += (s, e) => {
Console.WriteLine(">>>StartDebugServer complete");
_debugServerStarter.Dispose();
_debugServerStarter = null;
};
_debugServerStarter.Navigate("chrome://remoteDebugging/content/moz-remote-debug.html");
}