private void InitializeCEF() { CefSettings settings = new CefSharp.CefSettings(); settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/GPMDP"; settings.WindowlessRenderingEnabled = true; settings.CefCommandLineArgs.Add("enable-smooth-scrolling", "1"); settings.CefCommandLineArgs.Add("enable-overlay-scrollbar", "1"); settings.CefCommandLineArgs.Add("high-dpi-support", "1"); settings.CefCommandLineArgs.Add("force-device-scale-factor", MaterialSkin.Utilities.DPIMath.ratioX(this).ToString()); if (Environment.Is64BitProcess) { settings.CefCommandLineArgs.Add("ppapi-flash-path", "Resources\\pepflashplayer64_20_0_0_267.dll"); } else { settings.CefCommandLineArgs.Add("ppapi-flash-path", "Resources\\pepflashplayer32_20_0_0_267.dll"); } settings.CefCommandLineArgs.Add("ppapi-flash-version", "20.0.0.267"); Cef.Initialize(settings); GPMBrowser = new CefSharp.WinForms.ChromiumWebBrowser("https://play.google.com/music/listen") { // Use this to inject our theming and modding javascript code ResourceHandlerFactory = new GPMResouceHandlerFactory(), // Stop that silly right click menu appearing MenuHandler = new GPMMenuHandler() }; GPMBrowser.RegisterAsyncJsObject("csharpinterface", new JSBound(this)); GPMBrowser.DragHandler = new GPMDragHandler(); GPMBrowser.Dock = DockStyle.Fill; Controls.Add(GPMBrowser); }
private void InitializeCEF() { CefSettings settings = new CefSharp.CefSettings(); settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/GPMDP"; settings.WindowlessRenderingEnabled = true; settings.CefCommandLineArgs.Add("enable-smooth-scrolling", "1"); settings.CefCommandLineArgs.Add("enable-overlay-scrollbar", "1"); settings.CefCommandLineArgs.Add("high-dpi-support", "1"); if (Environment.Is64BitProcess) { settings.CefCommandLineArgs.Add("ppapi-flash-path", "Resources\\pepflashplayer64_20_0_0_267.dll"); } else { settings.CefCommandLineArgs.Add("ppapi-flash-path", "Resources\\pepflashplayer32_20_0_0_267.dll"); } settings.CefCommandLineArgs.Add("ppapi-flash-version", "20.0.0.267"); Cef.Initialize(settings); GPMBrowser = new CefSharp.WinForms.ChromiumWebBrowser("https://play.google.com/music/listen") { // Use this to inject our theming and modding javascript code ResourceHandlerFactory = new GPMResouceHandlerFactory(), // Stop that silly right click menu appearing MenuHandler = new GPMMenuHandler() }; GPMBrowser.RegisterAsyncJsObject("csharpinterface", new JSBound(this)); GPMBrowser.DragHandler = new GPMDragHandler(); GPMBrowser.Dock = DockStyle.Fill; Controls.Add(GPMBrowser); }
private BrowserManager() { InitCef(); Browser = new CefSharp.WinForms.ChromiumWebBrowser("about:blank") { BrowserSettings = { DefaultEncoding = "UTF-8", WebGl = CefState.Disabled } }; //Browser.JavascriptObjectRepository.Register("im", im, true, null);//新版本cef Browser.RegisterAsyncJsObject("im", im); //老版本的cef使用 Browser.FrameLoadEnd += OnFrameLoadEnd; Browser.MenuHandler = new MenuHandler(); }
private void InitializeCEF() { CefSettings settings = new CefSharp.CefSettings(); settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/GPMDP"; settings.WindowlessRenderingEnabled = true; settings.CefCommandLineArgs.Add("enable-smooth-scrolling", "1"); settings.CefCommandLineArgs.Add("enable-overlay-scrollbar", "1"); settings.CefCommandLineArgs.Add("enable-npapi", "1"); Cef.Initialize(settings); GPMBrowser = new CefSharp.WinForms.ChromiumWebBrowser("http://play.google.com/music/listen") { // Use this to inject our theming and modding javascript code ResourceHandlerFactory = new GPMResouceHandlerFactory(), // Stop that silly right click menu appearing MenuHandler = new GPMMenuHandler() }; GPMBrowser.RegisterAsyncJsObject("csharpinterface", new JSBound(this)); GPMBrowser.Dock = DockStyle.Fill; Controls.Add(GPMBrowser); }
private void InitializeCEF() { CefSettings settings = new CefSharp.CefSettings(); settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/GPMDP"; settings.WindowlessRenderingEnabled = true; settings.CefCommandLineArgs.Add("enable-smooth-scrolling", "1"); settings.CefCommandLineArgs.Add("enable-overlay-scrollbar", "1"); settings.CefCommandLineArgs.Add("enable-npapi", "1"); Cef.Initialize(settings); GPMBrowser = new CefSharp.WinForms.ChromiumWebBrowser("http://play.google.com/music/listen") { // Use this to inject our theming and modding javascript code ResourceHandlerFactory = new GPMResouceHandlerFactory(), // Stop that silly right click menu appearing MenuHandler = new GPMMenuHandler() }; GPMBrowser.RegisterAsyncJsObject("csharpinterface", new JSBound(this)); GPMBrowser.Dock = DockStyle.Fill; Controls.Add(GPMBrowser); }