private void InitHotkeys() { // browser hotkeys //KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.W, true); //KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.Escape, true); KeyboardHandler.AddHotKey(this, AddBlankTab, Keys.T, true); KeyboardHandler.AddHotKey(this, RefreshActiveTab, Keys.F5); KeyboardHandler.AddHotKey(this, OpenDeveloperTools, Keys.F12); KeyboardHandler.AddHotKey(this, NextUrl, Keys.Right, true); KeyboardHandler.AddHotKey(this, PrevUrl, Keys.Left, true); KeyboardHandler.AddHotKey(this, Print, Keys.P, true); KeyboardHandler.AddHotKey(this, OpenDownloadsTab, Keys.J, true); KeyboardHandler.AddHotKey(this, OpenHistoryTab, Keys.H, true); KeyboardHandler.AddHotKey(this, OpenBookmarkTab, Keys.B, true); KeyboardHandler.AddHotKey(this, ViewSource, Keys.U, true); // search hotkeys KeyboardHandler.AddHotKey(this, OpenSearch, Keys.F, true); KeyboardHandler.AddHotKey(this, CloseSearch, Keys.Escape); KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.Escape); KeyboardHandler.AddHotKey(this, FullScreenshot, Keys.S, true, true); KeyboardHandler.AddHotKey(this, Screenshot, Keys.S, true); }
private void InitCef() { CefSharpSettings.ShutdownOnExit = false; CefSettings settings = new CefSettings(); settings.RegisterScheme(new CefCustomScheme { SchemeName = SchemeHandlerFactory.SchemeName, SchemeHandlerFactory = new SchemeHandlerFactory() }); settings.LogSeverity = LogSeverity.Error; settings.CefCommandLineArgs.Add("debug-plugin-loading", "1"); //settings.CefCommandLineArgs.Add("debug-plugin-loading", "1"); settings.UserAgent = UserAgent; settings.CefCommandLineArgs.Add("proxy-server", "127.0.0.1:9666"); settings.CefCommandLineArgs.Add("proxy-auto-detect", "1"); settings.CefCommandLineArgs.Add("winhttp-proxy-resolver", "1"); //settings.CefCommandLineArgs.Add("no-proxy-server", "1"); settings.CefCommandLineArgs.Add("ppapi-flash-path", AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"PepperFlash\pepflashplayer.dll"); settings.CefCommandLineArgs.Add("ppapi-flash-version", "32.0.0.192"); settings.CefCommandLineArgs.Add("enable-npapi", "1"); //settings.CefCommandLineArgs.Add("enable-media-stream", "1"); settings.CefCommandLineArgs.Add("disable-gpu", "1"); //settings.CefCommandLineArgs.Add("disable-gpu-vsync", "1"); settings.IgnoreCertificateErrors = true; settings.ResourcesDirPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; settings.CachePath = GetAppDir("Cache"); //.AddWebPluginPath(@"C:\Program Files (x86)\VideoLAN\VLC\npvlc.dll"); //CefRuntime.AddWebPluginDirectory(@"C:\Program Files (x86)\VideoLAN\VLC"); Cef.Initialize(settings); DHandler = new DownloadHandler(this); LHandler = new LifeSpanHandler(this); MHandler = new ContextMenuHandler(this); KHandler = new KeyboardHandler(this); RHandler = new RequestHandler(this); }