CefSharp 常用设置
CefSettings settings = new CefSettings();
settings.CefCommandLineArgs.Add("autoplay-policy", "no-user-gesture-required"); //视频自动播放
settings.CefCommandLineArgs.Add("disable-usb-keyboard-detect", "1"); //禁U盘
settings.CefCommandLineArgs.Add("enable-media-stream", "1"); //可以调视频
settings.CefCommandLineArgs.Add("no-proxy-server", "1"); //不开代理 禁用代理设置
settings.CefCommandLineArgs.Add("enable-speech-input", "1"); //语音输入
settings.CefCommandLineArgs.Add("touch-events", "1"); //开启触屏事件
settings.CefCommandLineArgs.Add("enable-webgl", "1");//开启WebgL功能
settings.CefCommandLineArgs.Add("ignore-gpu-blacklist", "1");//忽略显卡黑名单
settings.CefCommandLineArgs.Add("--disable-web-security", "1");//跨域设置
settings.CefCommandLineArgs.Add("--js-flags", "--max_old_space_size=4096");//设置cef中js的最大内存空间4G
settings.CefCommandLineArgs.Add("disable-gpu", "1");//禁用硬件加速
settings.SetOffScreenRenderingBestPerformanceArgs();//禁用屏外渲染最佳性能
settings.MultiThreadedMessageLoop = true://此处的目的是让浏览器的消息循环在一个单独的线程中执行 默认值为true
settings.LegacyJavascriptBindingEnabled = true;//允许调用JS函数调用后端代码
settings.WcfEnabled = true;
Cef.Initialize(settings);
https://blog.csdn.net/weixin_38110122/article/details/128671694