Пример #1
0
 private static void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
 {
     e.Settings.LocalesDirPath      = Path.GetFullPath(@"cef\Resources\locales");
     e.Settings.ResourcesDirPath    = Path.GetFullPath(@"cef\Resources");
     e.Settings.RemoteDebuggingPort = port;
     //e.Settings.CachePath = (@"C:\cefcache");
     //e.Settings.PersistSessionCookies = true;
 }
        internal static void RaiseOnBeforeCfxInitialize(CfxSettings settings, CfxBrowserProcessHandler processHandler)
        {
            var handler = OnBeforeCfxInitialize;

            if (handler != null)
            {
                var e = new OnBeforeCfxInitializeEventArgs(settings, processHandler);
                handler(e);
            }
        }
Пример #3
0
        private void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
        {
            var settings = e.Settings;

            _SettingsBuilder?.Invoke(settings);

            settings.NoSandbox             = true;
            settings.LocalesDirPath        = System.IO.Path.GetFullPath(@"cef\Resources\locales");
            settings.ResourcesDirPath      = System.IO.Path.GetFullPath(@"cef\Resources");
            settings.BrowserSubprocessPath = System.IO.Path.GetFullPath("ChromiumFXRenderProcess.exe");
            settings.SingleProcess         = false;
        }
        private void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
        {
            var settings = e.Settings;

            _SettingsBuilder?.Invoke(settings);

            settings.NoSandbox = true;
            settings.LocalesDirPath = System.IO.Path.GetFullPath(@"cef\Resources\locales");
            settings.ResourcesDirPath = System.IO.Path.GetFullPath(@"cef\Resources");
            settings.BrowserSubprocessPath = System.IO.Path.GetFullPath("ChromiumFXRenderProcess.exe");
            settings.SingleProcess = false;
        }
 private static void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
 {
     e.Settings.LocalesDirPath        = System.IO.Path.GetFullPath(@".\cef\Resources\locales");
     e.Settings.ResourcesDirPath      = System.IO.Path.GetFullPath(@".\cef\Resources");
     e.Settings.BrowserSubprocessPath = System.IO.Path.GetFullPath(@".\cef\Cfx\BrowserSubProcess.exe");
     if (!App.Debug)
     {
         e.Settings.LogSeverity = CfxLogSeverity.Error;
     }
     e.Settings.WindowlessRenderingEnabled = false;
     e.Settings.MultiThreadedMessageLoop   = true;
     //CfxRuntime.EnableHighDpiSupport();
 }
Пример #6
0
        private void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
        {
            var settings = e.Settings;

            _SettingsBuilder?.Invoke(settings);

            settings.LocalesDirPath           = GetPath($@"{CefRepo}\Resources\locales");
            settings.Locale                   = Thread.CurrentThread.CurrentCulture.ToString();
            settings.ResourcesDirPath         = GetPath($@"{CefRepo}\Resources");
            settings.BrowserSubprocessPath    = GetPath("ChromiumFXRenderProcess.exe");
            settings.MultiThreadedMessageLoop = true;
            settings.NoSandbox                = true;
        }
Пример #7
0
        private void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
        {
            CfxRuntime.EnableHighDpiSupport();

            var settings = e.Settings;

            _SettingsBuilder?.Invoke(settings);

            settings.LocalesDirPath           = GetPath(@"cef\Resources\locales");
            settings.Locale                   = Thread.CurrentThread.CurrentCulture.ToString();
            settings.ResourcesDirPath         = GetPath(@"cef\Resources");
            settings.BrowserSubprocessPath    = GetPath("ChromiumFXRenderProcess.exe");
            settings.SingleProcess            = false;
            settings.MultiThreadedMessageLoop = true;
            settings.NoSandbox                = true;
        }
        private static void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
        {
            var cachePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Application.ProductName, "Cache");

            if (!System.IO.Directory.Exists(cachePath))
            {
                System.IO.Directory.CreateDirectory(cachePath);
            }

            var basePath = System.IO.Path.GetDirectoryName(new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath);// AppDomain.CurrentDomain.BaseDirectory;


            if (string.IsNullOrEmpty(_cefResourcePath))
            {
                _cefResourcePath = _libCefDirPath;
            }

            //var resourcePath = Path.Combine(_libCefDirPath);

            var libCefLocalesPath = Path.Combine(_cefResourcePath, "locales");


            if (enableDevTools)
            {
                e.Settings.RemoteDebuggingPort = devtoolPort;
            }

            e.Settings.Locale = "zh-CN";

            e.Settings.LocalesDirPath   = libCefLocalesPath;
            e.Settings.ResourcesDirPath = _cefResourcePath;


            e.Settings.WindowlessRenderingEnabled = ChromiumWebBrowserBase.WindowLess;


            e.Settings.CachePath   = cachePath;
            e.Settings.LogFile     = Path.Combine(basePath, "debug.log1");
            e.Settings.LogSeverity = CfxLogSeverity.Verbose;

            onBeforeCfxInitializeCallback?.Invoke(new OnCSBeforeCfxInitializeEventArgs(e.Settings, e.ProcessHandler));
        }
Пример #9
0
        static void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
        {
            e.Settings.SingleProcess = true;

            //缓存数据存放位置
            e.Settings.CachePath = Path.GetFullPath($@"{_basePath}\LocalCache");
            //启用无窗口渲染
            e.Settings.WindowlessRenderingEnabled = true;
            //无沙箱
            e.Settings.NoSandbox = true;
            //集成消息循环(Message Loop Integration)
            //仅 Windows 操作系统有效
            e.Settings.MultiThreadedMessageLoop = true;
            //禁用日志
            e.Settings.LogSeverity = Chromium.CfxLogSeverity.Disable;
            //指定中文为当前CEF环境的默认语言
            e.Settings.AcceptLanguageList = "zh-CN";
            e.Settings.Locale             = "zh-CN";
            //资源文件及语言环境目录
            e.Settings.LocalesDirPath   = Path.GetFullPath($@"{_basePath}\Resources\locales");
            e.Settings.ResourcesDirPath = Path.GetFullPath($@"{_basePath}\Resources");
        }
Пример #10
0
 static void ChromiumWebBrowser_OnBeforeCfxInitialize(OnBeforeCfxInitializeEventArgs e)
 {
     e.Settings.LocalesDirPath   = System.IO.Path.GetFullPath(@"cef\Resources\locales");
     e.Settings.ResourcesDirPath = System.IO.Path.GetFullPath(@"cef\Resources");
 }