Example #1
0
        /// <summary>
        /// this is done just once, to globally initialize CefSharp/CEF
        /// </summary>
        private void InitBrowser()
        {
            CefSharpSettings.LegacyJavascriptBindingEnabled = true;
            CefSharpSettings.WcfEnabled = false;

            CefSettings settings = new CefSettings();

            settings.RegisterScheme(new CefCustomScheme {
                SchemeName           = InternalURL,
                SchemeHandlerFactory = new SchemeHandlerFactory()
            });

            settings.UserAgent          = UserAgent;
            settings.AcceptLanguageList = AcceptLanguage;

            settings.IgnoreCertificateErrors = true;

            settings.CachePath = GetAppDir("Cache");

            Cef.Initialize(settings);

            dHandler = new DownloadHandler(this);
            lHandler = new LifeSpanHandler(this);
            mHandler = new ContextMenuHandler(this);
            kHandler = new KeyboardHandler(this);
            rHandler = new RequestHandler(this);

            InitDownloads();

            host = new HostHandler(this);

            AddNewBrowser(tabStrip1, HomepageURL);
        }
        /// <summary>
        /// this is done just once, to globally initialize CefSharp/CEF
        /// </summary>
        private void InitBrowser()
        {
            CefSettings settings = new CefSettings();

            settings.RegisterScheme(new CefCustomScheme {
                SchemeName           = "sharpbrowser",
                SchemeHandlerFactory = new SchemeHandlerFactory()
            });

            settings.UserAgent = UserAgent;

            settings.IgnoreCertificateErrors = true;

            settings.CachePath = GetAppDir("Cache");

            Cef.Initialize(settings);

            dHandler = new DownloadHandler(this);
            lHandler = new LifeSpanHandler(this);
            mHandler = new ContextMenuHandler(this);
            kHandler = new KeyboardHandler(this);
            rHandler = new RequestHandler(this);

            InitDownloads();

            host = new HostHandler(this);

            AddNewBrowser(tabStrip1, HomepageURL);
        }