Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathExample.cs
More file actions
Latest commit
39 lines (37 loc) · 2.01 KB
/
Copy pathExample.cs
File metadata and controls
39 lines (37 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ExampleCefSharp Web Browser.cs
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.IO;
usingSystem.Windows.Forms;
usingCefSharp.WinForms;
usingCefSharp;
namespaceCefSharp_Web_Browser
publicpartialclassForm1:Form
{
publicChromiumWebBrowserCefSharp_Web_Browser;
publicForm1()
{
InitializeComponent();
// Text = "CefSharp Web Browser";
ShowIcon=false;
//// Set Google API keys, used for Geolocation requests sans GPS. See http://www.chromium.org/developers/how-tos/api-keys
Environment.SetEnvironmentVariable("GOOGLE_API_KEY","#");
Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_ID","#");
Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_SECRET","#");
CefSettingssettings=newCefSettings();
settings.BrowserSubprocessPath=System.IO.Path.GetFullPath("CefSharp.BrowserSubprocess.exe");
Cef.Initialize(settings);
/*
ChromiumWebBrowser CefSharp_Web_Browser = new ChromiumWebBrowser("https://www.google.com/")
{
BrowserSettings = { DefaultEncoding = "UTF-8", Databases = CefState.Disabled, JavascriptCloseWindows = CefState.Default, JavascriptDomPaste = CefState.Disabled, Javascript = CefState.Enabled, ApplicationCache = CefState.Disabled, FileAccessFromFileUrls = CefState.Enabled, TabToLinks = CefState.Default, UniversalAccessFromFileUrls = CefState.Default, WebSecurity = CefState.Enabled, LocalStorage = CefState.Disabled, ImageLoading = CefState.Default, TextAreaResize = CefState.Default, JavascriptAccessClipboard = CefState.Enabled, ImageShrinkStandaloneToFit = CefState.Default, Plugins = CefState.Enabled, WebGl = CefState.Disabled }
};
CefSharp_Web_Browser.Dock = DockStyle.Fill;
TabControl browserTabControl = new TabControl(); TabPage tpage = new TabPage();
tpage.Text = " App CefSharp Web Browser "; tpage.Show(); browserTabControl.Controls.Add(tpage);
*/
}