private static void app_OnBeforeCommandLineProcessing(object sender, Chromium.Event.CfxOnBeforeCommandLineProcessingEventArgs e) { // e.CommandLine.AppendSwitch("enable-speech-input"); e.CommandLine.AppendSwitch("ignore-gpu-blacklist"); e.CommandLine.AppendSwitch("enable-experimental-canvas-features"); e.CommandLine.AppendSwitch("enable-gpu-memory-buffer-video-frames"); e.CommandLine.AppendSwitch("enable-native-gpu-memory-buffers"); e.CommandLine.AppendSwitchWithValue("disable-gpu-vsync", "beginframe"); e.CommandLine.AppendSwitchWithValue("enable-accelerated-vpx-decode", "0x03"); // DO NOT USE THIS TO BROWSE THE INTERNET e.CommandLine.AppendSwitch("no-user-gesture-required"); e.CommandLine.AppendSwitch("allow-file-access"); e.CommandLine.AppendSwitch("allow-file-access-from-files"); e.CommandLine.AppendSwitch("allow-cross-origin-auth-prompt"); e.CommandLine.AppendSwitchWithValue("disable-features", "CrossSiteDocumentBlockingAlways," + "CrossSiteDocumentBlockingIfIsolating" ); e.CommandLine.AppendSwitchWithValue("enable-features", "OverlayScrollbar" ); //e.CommandLine.AppendSwitchWithValue("enable-blink-features", // "PaintTouchActionRects" //); e.CommandLine.AppendSwitch("smooth-scrolling"); e.CommandLine.AppendSwitchWithValue("touch-events", "enabled"); e.CommandLine.AppendSwitch("disable-pinch"); // enable pepper flash or system Flash if (Directory.Exists(Path.Combine(Globals.AssemblyDir, @"cef\PepperFlash"))) { e.CommandLine.AppendSwitchWithValue("ppapi-flash-version", "19.0.0.201"); e.CommandLine.AppendSwitchWithValue("ppapi-flash-path", Path.Combine(Globals.AssemblyDir, @"cef\PepperFlash\pepflashplayer.dll")); } else { e.CommandLine.AppendSwitch("enable-system-flash"); } // MessageBox.Show(e.CommandLine.CommandLineString); }
private void App_OnBeforeCommandLineProcessing(object sender, Chromium.Event.CfxOnBeforeCommandLineProcessingEventArgs e) { var command = e.CommandLine; command.AppendSwitchWithValue("default-encoding", "utf-8"); command.AppendSwitch("allow-file-access-from-files"); command.AppendSwitch("allow-universal-access-from-files"); command.AppendSwitch("disable-web-security"); command.AppendSwitch("ignore-certificate-errors"); foreach (var action in globalConfiguration.CommandLineBuildActions) { action?.Invoke(e.ProcessType, command); } if (Bootstrap.IsDebugModeEnabled) { Bootstrap.Log("Command Line Arguments ->".Gray()); Bootstrap.Text(command.CommandLineString); } }
private static void ChromiumWebBrowser_OnBeforeCommandLineProcessing(Chromium.Event.CfxOnBeforeCommandLineProcessingEventArgs e) { Console.WriteLine("ChromiumWebBrowser_OnBeforeCommandLineProcessing"); Console.WriteLine(e.CommandLine.CommandLineString); }
static void ChromiumWebBrowser_OnBeforeCommandLineProcessing(Chromium.Event.CfxOnBeforeCommandLineProcessingEventArgs e) { e.CommandLine.AppendSwitchWithValue("ppapi-flash-version", "32.0.0.171"); //当前CEF文件夹内的flash版本为32.0.0.171=>ppapi e.CommandLine.AppendSwitchWithValue("ppapi-flash-path", "pepflashplayer32_32_0_0_171.dll"); Environment.SetEnvironmentVariable("ComSpec", "cmd.exe"); //解决flash中黑框闪一下的问题,且cef文件夹内需要放置一个无效的cmd.exe(已放于cef文件夹) }