Add project
This commit is contained in:
commit
7fcb279842
961 changed files with 370491 additions and 0 deletions
65
WebBrowser/Program.cs
Normal file
65
WebBrowser/Program.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
using CefSharp;
|
||||
using CefSharp.WinForms;
|
||||
using EasyTabs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace WebBrowser
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static AppContainer container;
|
||||
|
||||
public static TitleBarTabsApplicationContext applicationContext;
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
container = new AppContainer();
|
||||
CefSettings settings = new CefSettings();
|
||||
|
||||
if (settings.CefCommandLineArgs.ContainsKey("enable-system-flash"))
|
||||
settings.CefCommandLineArgs.Remove("enable-system-flash");
|
||||
settings.CefCommandLineArgs.Add("enable-system-flash", "1");
|
||||
settings.CefCommandLineArgs.Add("ppapi-flash-path", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "pepflashplayer64_32_0_0_465.dll"));
|
||||
settings.CefCommandLineArgs.Add("ppapi-flash-version", "32.0.0.465");
|
||||
settings.CefCommandLineArgs["plugin-policy"] = "allow";
|
||||
settings.UserAgent = "cpprestsdk/2.9.0 Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 XeroBrowser/1.0";
|
||||
settings.CefCommandLineArgs.Add("enable-media-stream", "1");
|
||||
Cef.EnableHighDPISupport();
|
||||
settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\CEF";
|
||||
|
||||
Cef.Initialize(settings);
|
||||
|
||||
container.Tabs.Add(
|
||||
|
||||
new EasyTabs.TitleBarTab(container)
|
||||
{
|
||||
Content = new frmBrowser
|
||||
{
|
||||
Text = "New Tab"
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
container.SelectedTabIndex = 0;
|
||||
|
||||
try {
|
||||
applicationContext = new TitleBarTabsApplicationContext();
|
||||
applicationContext.Start(container);
|
||||
Application.Run(applicationContext);
|
||||
}
|
||||
catch (Exception) { };
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue