Skip to content

Commit e4327c6

Browse files
committed
major feature refresh
1 parent 12e412d commit e4327c6

25 files changed

+1124
-753
lines changed

README.md

+21-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ SharpBrowser is the fastest open source C# web browser there is! Slightly faster
44

55
## Features
66

7-
- HTML5, CSS3, JS, HTML5 Video, WebGL 3D, WebAssembly, etc
7+
- HTML5, CSS3, JS, HTML5 Video, WebGL 3D, WebAssembly
88
- Tabbed browsing
9-
- Address bar (also opens Google)
10-
- Back, Forward, Stop, Refresh
9+
- Popups open in new tabs
10+
- When the last tab is closed, the browser window closes down
11+
- Address bar (also opens Google or any search engine)
12+
- Back, Forward, Stop, Refresh, Home, Menu button
13+
- Print and Print to PDF
1114
- Developer tools
1215
- Search bar (also highlights all instances)
13-
- Download manager
16+
- File downloads and download manager
1417
- Custom error pages
1518
- Custom context menu
16-
- Easily add vendor-specific branding, buttons or hotkeys
19+
- Easily add [vendor-specific branding](#customization), styling, buttons or hotkeys
1720
- View online & offline webpages
1821

1922
## Hotkeys
@@ -26,10 +29,13 @@ Ctrl+N | Add a new window
2629
Ctrl+W | Close active tab
2730
Ctrl+MiddleClick | Close Tab
2831
F5 | Refresh active tab
32+
F11 | Toggle fullscreen
2933
F12 | Open developer tools
3034
Ctrl+Tab | Switch to the next tab
3135
Ctrl+Shift+Tab | Switch to the previous tab
3236
Ctrl+F | Open search bar (Enter to find next, Esc to close)
37+
Ctrl+P | Print
38+
Ctrl+Shift+P | Print to PDF
3339

3440

3541
## System requirements
@@ -47,11 +53,20 @@ Ctrl+F | Open search bar (Enter to find next, Esc to close)
4753
- See the [Compilation Guide](docs/Compilation.md) for steps to get started.
4854

4955

56+
## Customization
57+
58+
- To configure the browser bring, name, URL, default search engine, modify the `BrowserConfig` class.
59+
60+
- To configure the tab style colors, modify the `BrowserTabStyle` class.
61+
62+
- To enable Javascript, WebGL, LocalStorage can be found in the `BrowserConfig` class.
63+
64+
65+
5066
## Documentation
5167

5268
- [User Guide](docs/Users.md)
5369
- [Compilation Guide](docs/Compilation.md)
54-
- [Configuration Guide](docs/Configuration.md)
5570
- [Distribution Guide](docs/Distribution.md)
5671

5772

docs/Configuration.md

-31
This file was deleted.

images/1.png

171 KB
Loading

images/2.png

885 KB
Loading

src/Browser/BrowserConfig.cs

+56-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,73 @@
11
using CefSharp;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
72

83
namespace SharpBrowser.Browser {
94
internal static class BrowserConfig {
105

11-
6+
/// <summary>
7+
/// The title of the window and application in Windows
8+
/// </summary>
129
public static string Branding = "SharpBrowser";
10+
/// <summary>
11+
/// The language you distribute it in
12+
/// </summary>
1313
public static string AcceptLanguage = "en-US,en;q=0.9";
14+
/// <summary>
15+
/// The browser's user agent string, which identifies itself to websites
16+
/// </summary>
1417
public static string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 /CefSharp Browser" + Cef.CefSharpVersion; // UserAgent to fix issue with Google account authentication
18+
/// <summary>
19+
/// The home page of your browser which shows up when you press the home button
20+
/// </summary>
1521
public static string HomepageURL = "https://www.google.com";
22+
/// <summary>
23+
/// The page you will see when you press "New Tab".
24+
/// </summary>
1625
public static string NewTabURL = "about:blank";
17-
public static string InternalURL = "sharpbrowser";
18-
public static string DownloadsURL = "sharpbrowser://storage/downloads.html";
19-
public static string FileNotFoundURL = "sharpbrowser://storage/errors/notFound.html";
20-
public static string CannotConnectURL = "sharpbrowser://storage/errors/cannotConnect.html";
26+
/// <summary>
27+
/// The main URL prefix for internal pages.
28+
/// </summary>
29+
public static string InternalScheme = "sharpbrowser";
30+
/// <summary>
31+
/// The URL for the downloads page
32+
/// </summary>
33+
public static string DownloadsURL = InternalScheme + "://storage/downloads.html";
34+
/// <summary>
35+
/// URL to display when local file is not fonud
36+
/// </summary>
37+
public static string FileNotFoundURL = InternalScheme + "://storage/errors/notFound.html";
38+
/// <summary>
39+
/// URL to display when internet connection is not available.
40+
/// </summary>
41+
public static string CannotConnectURL = InternalScheme + "://storage/errors/cannotConnect.html";
42+
/// <summary>
43+
/// The search string; it must be the string before the search result.
44+
/// Examples:
45+
/// https://www.google.com/search?q=
46+
/// https://www.bing.com/search?q=
47+
/// https://duckduckgo.com/?q=
48+
/// </summary>
2149
public static string SearchURL = "https://www.google.com/search?q=";
2250

23-
public static bool WebSecurity = true;
24-
public static bool CrossDomainSecurity = true;
51+
/// <summary>
52+
/// Is LocalStorage enabled for webpages?
53+
/// </summary>
54+
public static bool LocalStorage = false;
55+
/// <summary>
56+
/// Is WebGL enabled for webpages?
57+
/// </summary>
2558
public static bool WebGL = true;
26-
public static bool ApplicationCache = true;
59+
/// <summary>
60+
/// Is JS enabled for webpages?
61+
/// </summary>
62+
public static bool Javascript = true;
63+
/// <summary>
64+
/// Can JS on webpages access the clipboard?
65+
/// </summary>
66+
public static bool JavascriptClipboard = true;
2767

68+
/// <summary>
69+
/// If true then the following proxy is used for all browsing and downloads.
70+
/// </summary>
2871
public static bool Proxy = false;
2972
public static string ProxyIP = "123.123.123.123";
3073
public static int ProxyPort = 123;

src/Browser/Model/BrowserTab.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
using CefSharp.WinForms;
22
using SharpBrowser.Controls.BrowserTabStrip;
33
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
84

95
namespace SharpBrowser.Browser.Model {
106
/// <summary>
@@ -22,7 +18,7 @@ internal class BrowserTab {
2218

2319
public DateTime DateCreated;
2420

25-
public BrowserTabStripItem Tab;
21+
public BrowserTabItem Tab;
2622
public ChromiumWebBrowser Browser;
2723

2824
}

src/Controls/BorderedTextBox.cs

-18
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,6 @@ protected override void OnPaint(PaintEventArgs e)
157157
}
158158

159159

160-
//private void TextBox_FontChanged(object sender, EventArgs e)
161-
//{
162-
// RefreshHeight(textBox);
163-
// this.Height = textBox.Height + 5;
164-
//}
165-
///// <summary>
166-
///// fix Textbox.borderNone bottom gets clipped issue
167-
///// </summary>
168-
///// <param name="textbox"></param>
169-
static void RefreshHeight(TextBox textbox)
170-
{
171-
172-
textbox.Multiline = true;
173-
Size s = TextRenderer.MeasureText("AĞÜüğGgpPa", textbox.Font, Size.Empty, TextFormatFlags.TextBoxControl);
174-
textbox.MinimumSize = new Size(0, s.Height + 1 + 3);
175-
textbox.Multiline = false;
176-
177-
}
178160
static int MeasureHeight(TextBox textbox)
179161
{
180162
Size size = TextRenderer.MeasureText("AĞÜüğGgpPa", textbox.Font, Size.Empty, TextFormatFlags.TextBoxControl);

src/Controls/BrowserTabStrip/BrowserTabStripItem.cs renamed to src/Controls/BrowserTabStrip/BrowserTabItem.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace SharpBrowser.Controls.BrowserTabStrip {
77
[ToolboxItem(false)]
88
[DefaultProperty("Title")]
99
[DefaultEvent("Changed")]
10-
public class BrowserTabStripItem : Panel {
10+
public class BrowserTabItem : Panel {
1111
private RectangleF stripRect = Rectangle.Empty;
1212

1313
private Image image;
@@ -120,15 +120,15 @@ public bool Selected {
120120

121121
public event EventHandler Changed;
122122

123-
public BrowserTabStripItem()
123+
public BrowserTabItem()
124124
: this(string.Empty, null) {
125125
}
126126

127-
public BrowserTabStripItem(Control displayControl)
127+
public BrowserTabItem(Control displayControl)
128128
: this(string.Empty, displayControl) {
129129
}
130130

131-
public BrowserTabStripItem(string caption, Control displayControl) {
131+
public BrowserTabItem(string caption, Control displayControl) {
132132
SetStyle(ControlStyles.OptimizedDoubleBuffer, value: true);
133133
SetStyle(ControlStyles.ResizeRedraw, value: true);
134134
SetStyle(ControlStyles.UserPaint, value: true);
@@ -180,7 +180,7 @@ private void UpdateText(string caption, Control displayControl) {
180180
}
181181
}
182182

183-
public void Assign(BrowserTabStripItem item) {
183+
public void Assign(BrowserTabItem item) {
184184
Visible = item.Visible;
185185
Text = item.Text;
186186
CanClose = item.CanClose;

0 commit comments

Comments
 (0)