Ejemplo n.º 1
0
        public void Initialize()
        {
            cachePath = Path.Combine(Environment.CurrentDirectory, "Browser Cache", "Cef");

            if (clearCacheOnStartup.Value)
            {
                try
                {
                    Directory.Delete(cachePath, true);

                    clearCacheOnStartup.Value = false;
                }
                catch
                {
                }
            }

            CefSetting.Proxy = new CefProxy("localhost", proxy.ListeningPort.ToString());
            CefSetting.SubprocessExitIfParentProcessClosed = true;
            CefClass.Initialize(new DefaultCefSettings
            {
                CachePath = cachePath
            });
            CefClass.GetGlobalCookieManager().SetStoragePath(Path.Combine(Environment.CurrentDirectory, "Browser Cookies", "Cef"), true);

            proxy.IsEnabled = true;
        }
Ejemplo n.º 2
0
 public void ClearCookie() => CefClass.GetGlobalCookieManager().DeleteCookies(null, null);