Esempio 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;
        }
Esempio n. 2
0
 public void Dispose() => CefClass.Shutdown();
Esempio n. 3
0
 public void ClearCookie() => CefClass.GetGlobalCookieManager().DeleteCookies(null, null);