public static void Main() { //Monitor parent process exit and close subprocesses if parent process exits first //This will at some point in the future becomes the default CefSharpSettings.SubprocessExitIfParentProcessClosed = true; //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; //Example of setting a command line argument //Enables WebRTC settings.CefCommandLineArgs.Add("enable-media-stream", "1"); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); var browser1 = new BrowserForm(); browser1.Show(); Application.Run(browser); }
public static int Main(string[] args) { #if ANYCPU CefRuntime.SubscribeAnyCpuAssemblyResolver(); #endif //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; //Example of setting a command line argument //Enables WebRTC // - CEF Doesn't currently support permissions on a per browser basis see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access // - CEF Doesn't currently support displaying a UI for media access permissions // //NOTE: WebRTC Device Id's aren't persisted as they are in Chrome see https://bitbucket.org/chromiumembedded/cef/issues/2064/persist-webrtc-deviceids-across-restart settings.CefCommandLineArgs.Add("enable-media-stream"); //https://peter.sh/experiments/chromium-command-line-switches/#use-fake-ui-for-media-stream settings.CefCommandLineArgs.Add("use-fake-ui-for-media-stream"); //For screen sharing add (see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access#comment-58677180) settings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing"); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); return(0); }
public static void Main() { Cef.Initialize(new CefSettings()); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { // Set Google API keys, used for Geolocation requests sans GPS. See http://www.chromium.org/developers/how-tos/api-keys // This will enable microphone and webcam to work. See https://console.cloud.google.com/iam-admin/serviceaccounts/project?project=flash-crawler-138718 Environment.SetEnvironmentVariable("GOOGLE_API_KEY", google_api_key); Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_ID", google_default_client_id); Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_SECRET", google_default_client_secret); var settings = new CefSettings(); settings.EnableInternalPdfViewerOffScreen(); settings.WindowlessRenderingEnabled = true; var osVersion = Environment.OSVersion; settings.CachePath = "cache"; // ENABLE Microphone, video, flash //settings.CefCommandLineArgs.Add("enable-system-flash", "1"); settings.CefCommandLineArgs.Add("enable-media-stream", "1"); settings.CefCommandLineArgs.Add("enable-speech-input", "1"); // settings.CefCommandLineArgs.Add("ppapi-flash-path", "1"); //settings.CefCommandLineArgs.Add("enable-npapi", "1"); //settings.CefCommandLineArgs.Add("disable-bundled-ppapi-flash", "1"); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, shutdownOnProcessExit: false, performDependencyCheck: true); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { var profileRoot = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Browser", "ProfileOptimization"); CefSharpSettings.SubprocessExitIfParentProcessClosed = true; var settings = new CefSettings() { CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; settings.CefCommandLineArgs.Add("enable-media-stream", "1"); settings.CommandLineArgsDisabled = true; settings.LogSeverity = LogSeverity.Disable; settings.CefCommandLineArgs.Add("enable-npapi", "1"); //settings.CefCommandLineArgs.Add("enable-system-flash", "1"); //Automatically discovered and load a system-wide installation of Pepper Flash. //settings.CefCommandLineArgs.Add("ppapi-flash-path", @"C:\WINDOWS\SysWOW64\Macromed\Flash\pepflashplayer32_18_0_0_209.dll"); //Load a specific pepper flash version (Step 1 of 2) //settings.CefCommandLineArgs.Add("ppapi-flash-version", "18.0.0.209"); //Load a specific pepper flash version (Step 2 of 2) Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); Cef.EnableHighDPISupport(); Cef.RegisterWidevineCdm(@".\WidevineCdm"); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; //Example of setting a command line argument //Enables WebRTC settings.CefCommandLineArgs.Add("enable-media-stream", "1"); // Custom scheme for memory images CefCustomScheme cefImagesInMemoryScheme = new CefCustomScheme { SchemeName = ImageMemorySchemeHandlerFactory.SchemeName, SchemeHandlerFactory = new ImageMemorySchemeHandlerFactory() }; settings.RegisterScheme(cefImagesInMemoryScheme); Bitmap image = new Bitmap("test.png"); ImageMemorySchemeHandlerFactory.AddImage("test.png", image); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); }
public MainForm() { InitializeComponent(); var browser = new BrowserForm(); browser.Show(dockPanel1); }
public static void Main() { Cef.Initialize(new CefSettings()); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(new CefSettings(), shutdownOnProcessExit:true, performDependencyCheck:true); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(new CefSettings(), shutdownOnProcessExit: true, performDependencyCheck: true); var browser = new BrowserForm(); Application.Run(browser); }
public static int Main(string[] args) { ChromiumManager.Initialize(); var browser = new BrowserForm(); Application.Run(browser); return(0); }
public static void Main() { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(new CefSettings(), performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); }
public static int Main(string[] args) { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); #if NETCOREAPP //We are using our current exe as the BrowserSubProcess //Multiple instances will be spawned to handle all the //Chromium proceses, render, gpu, network, plugin, etc. var subProcessExe = new CefSharp.BrowserSubprocess.BrowserSubprocessExecutable(); var result = subProcessExe.Main(args); if (result > 0) { return(result); } #endif var cacheDirBase = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "cache"); var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = cacheDirBase }; #if NETCOREAPP //We use our Applications exe as the BrowserSubProcess, multiple copies //will be spawned var exePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; settings.BrowserSubprocessPath = exePath; #endif //Example of setting a command line argument //Enables WebRTC // - CEF Doesn't currently support permissions on a per browser basis see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access // - CEF Doesn't currently support displaying a UI for media access permissions // //NOTE: WebRTC Device Id's aren't persisted as they are in Chrome see https://bitbucket.org/chromiumembedded/cef/issues/2064/persist-webrtc-deviceids-across-restart settings.CefCommandLineArgs.Add("enable-media-stream"); //https://peter.sh/experiments/chromium-command-line-switches/#use-fake-ui-for-media-stream settings.CefCommandLineArgs.Add("use-fake-ui-for-media-stream"); //For screen sharing add (see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access#comment-58677180) settings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing"); settings.CefCommandLineArgs.Add("disable-application-cache", "1"); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); return(0); }
public static void Main() { var settings = new CefSettings(); settings.LogSeverity = LogSeverity.Verbose; var args = settings.CefCommandLineArgs; // Set up be default //settings.CefCommandLineArgs.Add("enable-system-flash", "1"); //Automatically discovered and load a system-wide installation of Pepper Flash. settings.CefCommandLineArgs.Add("enable-npapi", "1"); //Enable NPAPI plugs which were disabled by default in Chromium 43 (NPAPI will be removed completely in Chromium 45) var version = settings.ProductVersion; Cef.Initialize(settings); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); //Perform dependency check to make sure all relevant resources are in our output directory. var settings = new CefSettings { RemoteDebuggingPort = 8088 }; Cef.Initialize(settings, shutdownOnProcessExit: false, performDependencyCheck: true); var browser = new BrowserForm(); Application.Run(browser); }
public static int Main(string[] args) { #if ANYCPU //Only required for PlatformTarget of AnyCPU AppDomain.CurrentDomain.AssemblyResolve += Resolver; #endif //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); //Set the browser cache location var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; //Set the resource scheme to load files from the filesystem string resourceFolder = Path.GetFullPath("Chart"); settings.RegisterScheme(new CefCustomScheme { SchemeName = "localfolder", DomainName = "cefsharp", SchemeHandlerFactory = new FolderSchemeHandlerFactory( rootFolder: resourceFolder, hostName: "cefsharp", defaultPage: "index.html" ) }); //Example of setting a command line argument //Enables WebRTC // - CEF Doesn't currently support permissions on a per browser basis see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access // - CEF Doesn't currently support displaying a UI for media access permissions // //NOTE: WebRTC Device Id's aren't persisted as they are in Chrome see https://bitbucket.org/chromiumembedded/cef/issues/2064/persist-webrtc-deviceids-across-restart settings.CefCommandLineArgs.Add("enable-media-stream"); //https://peter.sh/experiments/chromium-command-line-switches/#use-fake-ui-for-media-stream settings.CefCommandLineArgs.Add("use-fake-ui-for-media-stream"); //For screen sharing add (see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access#comment-58677180) settings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing"); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); return(0); }
private static void LoadApp() { //执行依赖检查以确保所有相关资源都在输出目录中 var settings = new CefSettings() { BrowserSubprocessPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, Environment.Is64BitProcess ? "x64" : "x86", "CefSharp.BrowserSubprocess.exe"), LogSeverity = LogSeverity.Disable//不显示日志 }; Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); }
public static int Main(string[] args) { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); #if NETCOREAPP //We are using our current exe as the BrowserSubProcess //Multiple instances will be spawned to handle all the //Chromium proceses, render, gpu, network, plugin, etc. var subProcessExe = new CefSharp.BrowserSubprocess.BrowserSubprocessExecutable(); var result = subProcessExe.Main(args); if (result > 0) { return(result); } #endif var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; #if NETCOREAPP //We use our Applications exe as the BrowserSubProcess, multiple copies //will be spawned var exePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; settings.BrowserSubprocessPath = exePath; #endif //Example of setting a command line argument //Enables WebRTC settings.CefCommandLineArgs.Add("enable-media-stream", "1"); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); // Holds debug information. Directory.CreateDirectory(OptionsForm.DataDirectory); var browser = new BrowserForm(); Application.Run(browser); return(0); }
public static void Main() { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { var settings = new CefSettings(); settings.LogSeverity = LogSeverity.Verbose; var args = settings.CefCommandLineArgs; // Set up be default //settings.CefCommandLineArgs.Add("enable-system-flash", "1"); //Automatically discovered and load a system-wide installation of Pepper Flash. settings.CefCommandLineArgs.Add("enable-npapi", "1"); //Enable NPAPI plugs which were disabled by default in Chromium 43 (NPAPI will be removed completely in Chromium 45) var version = settings.ProductVersion; Cef.Initialize(settings); var browser = new BrowserForm(); Application.Run(browser); }
public static void Main() { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache"), RemoteDebuggingPort = 8088 }; DownloadRepository.GlobalRootFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Download"); settings.RegisterScheme(new CefCustomScheme { SchemeName = "localfolder", DomainName = "cefsharp", SchemeHandlerFactory = new CefSharpSchemeHandlerFactory(rootFolder: @".\Resources", hostName: "cefsharp", //Optional param no hostname/domain checking if null defaultPage: "home.html") //Optional param will default to index.html }); BoundObject.ResourceFolder = Path.GetFullPath(@".\Resources"); BoundObject.SchemeRoot = "localfolder://cefsharp"; //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); Global.ProgramsRepository = new ProgramsRepository(); ProgramsCommand.Programs.ProgramsRepository = Global.ProgramsRepository; ProgramsCommand.Processes.ProgramsRepository = Global.ProgramsRepository; Global.DownloadRepository = new DownloadRepository(); DownloadCommand.Download.DownloadRepository = Global.DownloadRepository; Global.DownloadRepository.PurgeIncompletes(); var browser = new BrowserForm(); Global.DownloadRepository.RegisterSink(new MyDownloadEventSink()); Application.Run(browser); }
public static void Main() { Program p = new Program(); //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(new CefSettings(), performDependencyCheck: true, browserProcessHandler: null); var browser = new BrowserForm(p); p._eyeXHost.Start(); try { Application.Run(browser); } catch (Exception e) { Console.WriteLine(e); } //p._eyeXHost.Dispose(); }
public static int Main(string[] args) { //To support High DPI this must be before CefSharp.BrowserSubprocess.SelfHost.Main so the BrowserSubprocess is DPI Aware Cef.EnableHighDPISupport(); var exitCode = CefSharp.BrowserSubprocess.SelfHost.Main(args); if (exitCode >= 0) { return(exitCode); } var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache"), BrowserSubprocessPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName }; //Example of setting a command line argument //Enables WebRTC // - CEF Doesn't currently support permissions on a per browser basis see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access // - CEF Doesn't currently support displaying a UI for media access permissions // //NOTE: WebRTC Device Id's aren't persisted as they are in Chrome see https://bitbucket.org/chromiumembedded/cef/issues/2064/persist-webrtc-deviceids-across-restart settings.CefCommandLineArgs.Add("enable-media-stream"); //https://peter.sh/experiments/chromium-command-line-switches/#use-fake-ui-for-media-stream settings.CefCommandLineArgs.Add("use-fake-ui-for-media-stream"); //For screen sharing add (see https://bitbucket.org/chromiumembedded/cef/issues/2582/allow-run-time-handling-of-media-access#comment-58677180) settings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing"); //Don't perform a dependency check Cef.Initialize(settings, performDependencyCheck: false); var browser = new BrowserForm(); Application.Run(browser); return(0); }
public static void Main() { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache"), }; settings.RegisterScheme(new CefCustomScheme() { SchemeName = SchemeHandler.CustomSchemeHandlerFactory.SchemeName, SchemeHandlerFactory = new SchemeHandler.CustomSchemeHandlerFactory() }); //Perform dependency check to make sure all relevant resources are in our output directory. Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); HostConfiguration hostConfigs = new HostConfiguration() { UrlReservations = new UrlReservations() { CreateAutomatically = true } }; using (var host = new NancyHost(new Uri("http://localhost:9696"), new DefaultNancyBootstrapper(), hostConfigs)) { host.Start(); var browser = new BrowserForm(); Application.Run(browser); } }
public static int Main(string[] args) { //For Windows 7 and above, best to include relevant app.manifest entries as well Cef.EnableHighDPISupport(); #if NETCOREAPP //We are using our current exe as the BrowserSubProcess //Multiple instances will be spawned to handle all the //Chromium proceses, render, gpu, network, plugin, etc. var subProcessExe = new CefSharp.BrowserSubprocess.BrowserSubprocessExecutable(); var result = subProcessExe.Main(args); if (result > 0) { return(result); } #endif var settings = new CefSettings() { //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; #if NETCOREAPP //We use our Applications exe as the BrowserSubProcess, multiple copies //will be spawned var exePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; settings.BrowserSubprocessPath = exePath; #endif settings.CefCommandLineArgs.Add("enable-media-stream"); var mngr = Cef.GetGlobalCookieManager(); Cookie Ac = new Cookie(); Ac.Name = "SameSite"; Ac.Value = "None; Secure"; Del endFunctionDelegate = new Del(EndFunction); var website = CredentialProvider.GetSiteUrl(); if (website != null) { if (website.Equals("https://suplementy.pl/")) { browser = new BrowserForm(endFunctionDelegate, settings, new SuplementyService()); } else if (website.Equals("https://www.mpcforum.pl/login")) { browser = new BrowserForm(endFunctionDelegate, settings, new MpcForumService()); } else { throw new Exception("Website is not supported"); } } else { throw new Exception("Url of website not found"); } int firstRunHour = 10; int firstRunMinute = 10; Scheduler.IntervalInDays(firstRunHour, firstRunMinute, 1, () => { Application.Run(browser); }); Console.ReadLine(); return(0); }
private void button2_Click(object sender, EventArgs e) { BrowserForm myBrowserForm = new BrowserForm(); myBrowserForm.Show(this); }
private void newTabToolStripMenuItem_Click(object sender, EventArgs e) { var browser = new BrowserForm(); browser.Show(dockPanel1); }
public OpenPageSelf(BrowserForm form) { m_form = form; }