fix every last warning in every last file (non-html at least)
This commit is contained in:
parent
dc5d26d13e
commit
f7eef416d9
14 changed files with 154 additions and 189 deletions
2
WebBrowser/AppContainer.Designer.cs
generated
2
WebBrowser/AppContainer.Designer.cs
generated
|
@ -1,6 +1,6 @@
|
|||
using System.ComponentModel;
|
||||
|
||||
namespace WebBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
partial class AppContainer
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using EasyTabs;
|
||||
|
||||
namespace WebBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public partial class AppContainer : TitleBarTabs
|
||||
{
|
||||
|
@ -16,9 +16,9 @@ namespace WebBrowser
|
|||
{
|
||||
return new TitleBarTab(this)
|
||||
{
|
||||
Content = new frmBrowser
|
||||
Content = new FrmBrowser
|
||||
{
|
||||
Text = "New tab"
|
||||
Text = @"New tab"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,18 +8,17 @@ using System.Net;
|
|||
using CefSharp;
|
||||
using CefSharp.Enums;
|
||||
using CefSharp.Structs;
|
||||
using WebBrowser;
|
||||
using Size = CefSharp.Structs.Size;
|
||||
|
||||
namespace DiamondCreeperBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public class DisplayHandler : IDisplayHandler
|
||||
{
|
||||
|
||||
public frmBrowser frmref;
|
||||
public DisplayHandler(frmBrowser frm)
|
||||
public FrmBrowser Frmref;
|
||||
public DisplayHandler(FrmBrowser frm)
|
||||
{
|
||||
frmref = frm;
|
||||
Frmref = frm;
|
||||
}
|
||||
public static Icon BytesToIcon(byte[] bytes)
|
||||
{
|
||||
|
@ -55,10 +54,10 @@ namespace DiamondCreeperBrowser
|
|||
{
|
||||
WebClient wc = new WebClient();
|
||||
byte[] buffer = wc.DownloadData(urls[0]);
|
||||
frmref.Icon = BytesToIcon(buffer);
|
||||
frmref.Update();
|
||||
frmref.ParentTabs.UpdateThumbnailPreviewIcon(frmref.ParentTabs.Tabs.Single(t => t.Content == frmref));
|
||||
frmref.ParentTabs.RedrawTabs();
|
||||
Frmref.Icon = BytesToIcon(buffer);
|
||||
Frmref.Update();
|
||||
Frmref.ParentTabs.UpdateThumbnailPreviewIcon(Frmref.ParentTabs.Tabs.Single(t => t.Content == Frmref));
|
||||
Frmref.ParentTabs.RedrawTabs();
|
||||
|
||||
|
||||
}
|
||||
|
@ -68,19 +67,19 @@ namespace DiamondCreeperBrowser
|
|||
WebClient wc = new WebClient();
|
||||
Uri furi = new Uri(chromiumWebBrowser.Address);
|
||||
byte[] buffer = wc.DownloadData(furi.GetLeftPart(UriPartial.Authority) +"/favicon.ico");
|
||||
frmref.Icon = BytesToIcon(buffer);
|
||||
frmref.Update();
|
||||
frmref.ParentTabs.UpdateThumbnailPreviewIcon(frmref.ParentTabs.Tabs.Single(t => t.Content == frmref));
|
||||
frmref.ParentTabs.RedrawTabs();
|
||||
Frmref.Icon = BytesToIcon(buffer);
|
||||
Frmref.Update();
|
||||
Frmref.ParentTabs.UpdateThumbnailPreviewIcon(Frmref.ParentTabs.Tabs.Single(t => t.Content == Frmref));
|
||||
Frmref.ParentTabs.RedrawTabs();
|
||||
}
|
||||
catch (Exception){
|
||||
ComponentResourceManager resources = new ComponentResourceManager(typeof(frmBrowser));
|
||||
frmref.Icon = ((Icon)(resources.GetObject("$this.Icon")));
|
||||
frmref.Update();
|
||||
frmref.ParentTabs.UpdateThumbnailPreviewIcon(frmref.ParentTabs.Tabs.Single(t => t.Content == frmref));
|
||||
frmref.ParentTabs.RedrawTabs();
|
||||
};
|
||||
};
|
||||
ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmBrowser));
|
||||
Frmref.Icon = ((Icon)(resources.GetObject("$this.Icon")));
|
||||
Frmref.Update();
|
||||
Frmref.ParentTabs.UpdateThumbnailPreviewIcon(Frmref.ParentTabs.Tabs.Single(t => t.Content == Frmref));
|
||||
Frmref.ParentTabs.RedrawTabs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnFullscreenModeChange(IWebBrowser chromiumWebBrowser, IBrowser browser, bool fullscreen)
|
||||
|
|
|
@ -7,10 +7,9 @@ using System.ComponentModel;
|
|||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using CefSharp;
|
||||
using WebBrowser;
|
||||
using Timer = System.Threading.Timer;
|
||||
|
||||
namespace DiamondCreeperBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public class DownloadHandler : IDownloadHandler
|
||||
{
|
||||
|
@ -18,30 +17,30 @@ namespace DiamondCreeperBrowser
|
|||
|
||||
public event EventHandler<DownloadItem> OnDownloadUpdatedFired;
|
||||
|
||||
public frmBrowser frmref;
|
||||
public DownloadHandler(frmBrowser frm)
|
||||
public FrmBrowser Frmref;
|
||||
public DownloadHandler(FrmBrowser frm)
|
||||
{
|
||||
frmref = frm;
|
||||
Frmref = frm;
|
||||
}
|
||||
|
||||
public DownloadProgress downloadProgress = new DownloadProgress();
|
||||
public DownloadItem downloadItem;
|
||||
public DownloadProgress DownloadProgress = new DownloadProgress();
|
||||
public DownloadItem DownloadItem;
|
||||
public void OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback)
|
||||
{
|
||||
OnBeforeDownloadFired?.Invoke(this, downloadItem);
|
||||
|
||||
this.downloadItem = downloadItem;
|
||||
this.DownloadItem = downloadItem;
|
||||
|
||||
try
|
||||
{
|
||||
frmref.Invoke((Action)delegate
|
||||
Frmref.Invoke((Action)delegate
|
||||
{
|
||||
downloadProgress.Show();
|
||||
downloadProgress.FormClosing += DownloadProgress_FormClosing;
|
||||
DownloadProgress.Show();
|
||||
DownloadProgress.FormClosing += DownloadProgress_FormClosing;
|
||||
});
|
||||
}
|
||||
catch (ObjectDisposedException){};
|
||||
|
||||
catch (ObjectDisposedException){}
|
||||
|
||||
|
||||
if (!callback.IsDisposed)
|
||||
{
|
||||
|
@ -54,10 +53,10 @@ namespace DiamondCreeperBrowser
|
|||
|
||||
private void DownloadProgress_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
downloadItem.IsCancelled = true;
|
||||
DownloadItem.IsCancelled = true;
|
||||
}
|
||||
|
||||
public Timer fivesecondtimer;
|
||||
public Timer Fivesecondtimer;
|
||||
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback)
|
||||
{
|
||||
OnDownloadUpdatedFired?.Invoke(this, downloadItem);
|
||||
|
@ -65,29 +64,28 @@ namespace DiamondCreeperBrowser
|
|||
|
||||
if (downloadItem.IsComplete)
|
||||
{
|
||||
fivesecondtimer = new Timer(tcallback, null, 1000 * 5, 1000 * 5);
|
||||
Fivesecondtimer = new Timer(tcallback, null, 1000 * 5, 1000 * 5);
|
||||
}
|
||||
|
||||
|
||||
frmref.Invoke((Action)delegate {
|
||||
downloadProgress.ProgressBar1.Value = downloadItem.PercentComplete;
|
||||
downloadProgress.ProgressPrecentage.Text = downloadItem.PercentComplete + "% " + (downloadItem.ReceivedBytes / 0x100000) + "MB / " + (downloadItem.TotalBytes / 0x100000) + "MB";
|
||||
downloadProgress.ProgressFileName.Text = Path.GetFileName(downloadItem.FullPath);
|
||||
downloadProgress.Update();
|
||||
try { } catch (InvalidAsynchronousStateException){};
|
||||
Frmref.Invoke((Action)delegate {
|
||||
DownloadProgress.ProgressBar1.Value = downloadItem.PercentComplete;
|
||||
DownloadProgress.ProgressPrecentage.Text = downloadItem.PercentComplete + @"% " + (downloadItem.ReceivedBytes / 0x100000) + @"MB / " + (downloadItem.TotalBytes / 0x100000) + @"MB";
|
||||
DownloadProgress.ProgressFileName.Text = Path.GetFileName(downloadItem.FullPath);
|
||||
DownloadProgress.Update();
|
||||
try { } catch (InvalidAsynchronousStateException){}
|
||||
});
|
||||
}
|
||||
|
||||
private void tcallback(object state)
|
||||
{
|
||||
try {
|
||||
frmref.Invoke((Action)delegate
|
||||
Frmref.Invoke((Action)delegate
|
||||
{
|
||||
downloadProgress.Close();
|
||||
DownloadProgress.Close();
|
||||
});
|
||||
}
|
||||
catch (InvalidOperationException){};
|
||||
|
||||
catch (InvalidOperationException){}
|
||||
}
|
||||
}
|
||||
}
|
5
WebBrowser/DownloadProgress.Designer.cs
generated
5
WebBrowser/DownloadProgress.Designer.cs
generated
|
@ -1,8 +1,7 @@
|
|||
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using Bunifu.UI.WinForms;
|
||||
|
||||
namespace DiamondCreeperBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
partial class DownloadProgress
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DiamondCreeperBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public partial class DownloadProgress : Form
|
||||
{
|
||||
|
@ -15,19 +15,9 @@ namespace DiamondCreeperBrowser
|
|||
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void DownloadProgress_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void bunifuLabel1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,8 @@
|
|||
using System;
|
||||
using CefSharp;
|
||||
using EasyTabs;
|
||||
using WebBrowser;
|
||||
using XeroBrowser;
|
||||
|
||||
namespace DiamondCreeperBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public class LifeSpanHandler : ILifeSpanHandler
|
||||
{
|
||||
|
@ -19,12 +17,12 @@ namespace DiamondCreeperBrowser
|
|||
|
||||
TitleBarTab tab = new TitleBarTab(Program.Container)
|
||||
{
|
||||
Content = new frmBrowser
|
||||
Content = new FrmBrowser
|
||||
{
|
||||
Text = "New Tab"
|
||||
Text = @"New Tab"
|
||||
}
|
||||
};
|
||||
frmBrowser frmref = (frmBrowser)tab.Content;
|
||||
FrmBrowser frmref = (FrmBrowser)tab.Content;
|
||||
frmref.chromiumWebBrowser1.Load(targetUrl);
|
||||
Program.Container.Tabs.Add(tab);
|
||||
Program.Container.SelectedTab = tab;
|
||||
|
|
|
@ -2,81 +2,86 @@
|
|||
using System.Windows.Forms;
|
||||
using CefSharp;
|
||||
|
||||
public class MenuHandler : IContextMenuHandler
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
|
||||
public class MenuHandler : IContextMenuHandler
|
||||
{
|
||||
// Remove any existent option using the Clear method of the model
|
||||
//
|
||||
//model.Clear();
|
||||
|
||||
Console.WriteLine("Context menu opened !");
|
||||
|
||||
// You can add a separator in case that there are more items on the list
|
||||
if (model.Count > 0)
|
||||
public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
|
||||
{
|
||||
model.AddSeparator();
|
||||
}
|
||||
// Remove any existent option using the Clear method of the model
|
||||
//
|
||||
//model.Clear();
|
||||
|
||||
Console.WriteLine(@"Context menu opened !");
|
||||
|
||||
// Add a new item to the list using the AddItem method of the model
|
||||
//model.AddItem((CefMenuCommand)113, "Copy link address");
|
||||
model.AddItem((CefMenuCommand)114, "Paste");
|
||||
|
||||
// Add a separator
|
||||
//model.AddSeparator();
|
||||
|
||||
}
|
||||
|
||||
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
|
||||
{
|
||||
// React to the first ID (show dev tools method)
|
||||
if (commandId == (CefMenuCommand)26501)
|
||||
{
|
||||
browser.GetHost().ShowDevTools();
|
||||
return true;
|
||||
}
|
||||
|
||||
// React to the second ID (show dev tools method)
|
||||
if (commandId == (CefMenuCommand)26502)
|
||||
{
|
||||
browser.GetHost().CloseDevTools();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Any new item should be handled through a new if statement
|
||||
if ((int)commandId == 113)
|
||||
{
|
||||
//using System.Windows.Forms;
|
||||
try
|
||||
// You can add a separator in case that there are more items on the list
|
||||
if (model.Count > 0)
|
||||
{
|
||||
Clipboard.SetText(parameters.SourceUrl);
|
||||
model.AddSeparator();
|
||||
}
|
||||
catch (ArgumentException) { };
|
||||
|
||||
|
||||
// Add a new item to the list using the AddItem method of the model
|
||||
//model.AddItem((CefMenuCommand)113, "Copy link address");
|
||||
model.AddItem((CefMenuCommand)114, "Paste");
|
||||
|
||||
// Add a separator
|
||||
//model.AddSeparator();
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
|
||||
{
|
||||
// React to the first ID (show dev tools method)
|
||||
if (commandId == (CefMenuCommand)26501)
|
||||
{
|
||||
browser.GetHost().ShowDevTools();
|
||||
return true;
|
||||
}
|
||||
|
||||
// React to the second ID (show dev tools method)
|
||||
if (commandId == (CefMenuCommand)26502)
|
||||
{
|
||||
browser.GetHost().CloseDevTools();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Any new item should be handled through a new if statement
|
||||
if ((int)commandId == 113)
|
||||
{
|
||||
//using System.Windows.Forms;
|
||||
try
|
||||
{
|
||||
Clipboard.SetText(parameters.SourceUrl);
|
||||
}
|
||||
catch (ArgumentException) { }
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
#pragma warning disable CS0162 // Unreachable code detected
|
||||
if ((int)commandId == 114)
|
||||
{
|
||||
//using System.Windows.Forms;
|
||||
Clipboard.GetText();
|
||||
}
|
||||
/*
|
||||
if ((int)commandId == 114)
|
||||
{
|
||||
//using System.Windows.Forms;
|
||||
Clipboard.GetText();
|
||||
}
|
||||
#pragma warning restore CS0162 // Unreachable code detected
|
||||
return false;
|
||||
return false;
|
||||
*/
|
||||
|
||||
// Return false should ignore the selected option of the user !
|
||||
}
|
||||
// Return false should ignore the selected option of the user !
|
||||
}
|
||||
|
||||
public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
|
||||
{
|
||||
public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
|
||||
{
|
||||
return false;
|
||||
public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,6 @@ using System.Windows.Forms;
|
|||
using CefSharp;
|
||||
using CefSharp.WinForms;
|
||||
using EasyTabs;
|
||||
using WebBrowser;
|
||||
|
||||
namespace XeroBrowser
|
||||
{
|
||||
|
@ -41,7 +40,7 @@ namespace XeroBrowser
|
|||
|
||||
new TitleBarTab(Container)
|
||||
{
|
||||
Content = new frmBrowser
|
||||
Content = new FrmBrowser
|
||||
{
|
||||
Text = @"New Tab"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Security.Cryptography.X509Certificates;
|
||||
using CefSharp;
|
||||
|
||||
namespace DiamondCreeperBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public class RequestHandler : IRequestHandler
|
||||
{
|
||||
|
|
8
WebBrowser/frmBrowser.Designer.cs
generated
8
WebBrowser/frmBrowser.Designer.cs
generated
|
@ -4,9 +4,9 @@ using Bunifu.UI.WinForms;
|
|||
using CefSharp.WinForms;
|
||||
using BunifuImageButton = Bunifu.UI.WinForms.BunifuImageButton;
|
||||
|
||||
namespace WebBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
partial class frmBrowser
|
||||
partial class FrmBrowser
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
@ -35,7 +35,7 @@ namespace WebBrowser
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmBrowser));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmBrowser));
|
||||
Bunifu.UI.WinForms.BunifuTextBox.StateProperties stateProperties5 = new Bunifu.UI.WinForms.BunifuTextBox.StateProperties();
|
||||
Bunifu.UI.WinForms.BunifuTextBox.StateProperties stateProperties6 = new Bunifu.UI.WinForms.BunifuTextBox.StateProperties();
|
||||
Bunifu.UI.WinForms.BunifuTextBox.StateProperties stateProperties7 = new Bunifu.UI.WinForms.BunifuTextBox.StateProperties();
|
||||
|
@ -564,7 +564,7 @@ namespace WebBrowser
|
|||
this.Controls.Add(this.bunifuCards1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "frmBrowser";
|
||||
this.Name = "FrmBrowser";
|
||||
this.Text = "frmBrowser";
|
||||
this.bunifuCards1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
|
|
@ -4,17 +4,16 @@ using System.IO;
|
|||
using System.Windows.Forms;
|
||||
using Bunifu.Utils;
|
||||
using CefSharp;
|
||||
using DiamondCreeperBrowser;
|
||||
using EasyTabs;
|
||||
using XeroBrowser.Properties;
|
||||
|
||||
namespace WebBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public partial class frmBrowser : Form
|
||||
public partial class FrmBrowser : Form
|
||||
{
|
||||
Uri fileUri;
|
||||
Uri fileUri2;
|
||||
public frmBrowser()
|
||||
Uri _fileUri;
|
||||
// Uri _fileUri2;
|
||||
public FrmBrowser()
|
||||
{
|
||||
InitializeComponent();
|
||||
chromiumWebBrowser1.DownloadHandler = new DownloadHandler(this);
|
||||
|
@ -22,8 +21,8 @@ namespace WebBrowser
|
|||
chromiumWebBrowser1.MenuHandler = new MenuHandler();
|
||||
chromiumWebBrowser1.DisplayHandler = new DisplayHandler(this);
|
||||
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "index.html");
|
||||
fileUri = new Uri(filePath);
|
||||
string fileUrl = fileUri.AbsoluteUri;
|
||||
_fileUri = new Uri(filePath);
|
||||
string fileUrl = _fileUri.AbsoluteUri;
|
||||
chromiumWebBrowser1.Load(fileUrl);
|
||||
txtSearchOrUrl.Text = "";
|
||||
CheckForIllegalCrossThreadCalls = false;
|
||||
|
@ -59,7 +58,7 @@ namespace WebBrowser
|
|||
chromiumWebBrowser1.Reload();
|
||||
}
|
||||
|
||||
private bool isBlocked;
|
||||
private bool _isBlocked;
|
||||
private void chromiumWebBrowser1_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
|
||||
{
|
||||
if (e.IsLoading)
|
||||
|
@ -75,14 +74,11 @@ namespace WebBrowser
|
|||
|
||||
try
|
||||
{
|
||||
if (this == null)
|
||||
return;
|
||||
|
||||
Invoke((Action)delegate
|
||||
{
|
||||
if (txtSearchOrUrl != null && chromiumWebBrowser1 != null)
|
||||
{
|
||||
if (!chromiumWebBrowser1.Address.EndsWith(fileUri.ToString()))
|
||||
if (!chromiumWebBrowser1.Address.EndsWith(_fileUri.ToString()))
|
||||
{
|
||||
txtSearchOrUrl.Text = chromiumWebBrowser1.Address;
|
||||
}
|
||||
|
@ -110,9 +106,9 @@ namespace WebBrowser
|
|||
else
|
||||
{
|
||||
txtSearchOrUrl.IconLeft = Resources.insecure1;
|
||||
if (!isBlocked)
|
||||
if (!_isBlocked)
|
||||
{
|
||||
MessageBox.Show("Warning: This site is insecure!, Your personal information may be at risk or hackers can install malicious software on your device.", "Xero Browser", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
MessageBox.Show(@"Warning: This site is insecure!, Your personal information may be at risk or hackers can install malicious software on your device.", @"Xero Browser", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,29 +133,29 @@ namespace WebBrowser
|
|||
string[] blockedUrls = { "https://diamondcreeper.org/1337", "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://www.youtube.com/watch?v=xm3YgoEiEDc", "https://www.youtube.com/watch?v=xvFZjo5PgG0", "https://www.youtube.com/watch?v=O91DT1pR1ew", "https://www.youtube.com/watch?v=o-YBDTqX_ZU", "https://www.youtube.com/watch?v=H8ZH_mkfPUY", "https://www.youtube.com/watch?v=o-YBDTqX_ZU", "https://www.youtube.com/watch?v=xvFZjo5PgG0" };
|
||||
string[] blockedDrms = { "netflix.com", "disneyplus.com" };
|
||||
|
||||
if (!isBlocked)
|
||||
if (!_isBlocked)
|
||||
{
|
||||
foreach (string blockedDrm in blockedDrms)
|
||||
{
|
||||
if (chromiumWebBrowser1.Address.StartsWith(blockedDrm))
|
||||
{
|
||||
chromiumWebBrowser1.Stop(); // cancel the navigation
|
||||
isBlocked = true;
|
||||
_isBlocked = true;
|
||||
chromiumWebBrowser1.LoadHtml("<html><body><h1>Error!</h1><h3>This website requires a DRM (Digital Rights Management) which Xero Browser does not support!</h3></body></html>", blockedDrm);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
foreach (string blockedUrl in blockedUrls)
|
||||
{
|
||||
if (chromiumWebBrowser1.Address.StartsWith(blockedUrl))
|
||||
{
|
||||
chromiumWebBrowser1.Stop(); // cancel the navigation
|
||||
isBlocked = true;
|
||||
_isBlocked = true;
|
||||
chromiumWebBrowser1.LoadHtml("<html><body><h1>Rickroll Blocked!</h1><p>Being rickrolled is disabled.</p></body></html>", blockedUrl);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +170,7 @@ namespace WebBrowser
|
|||
|
||||
private void btnSettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
Backdrop.Show(new frmSettings());
|
||||
Backdrop.Show(new FrmSettings());
|
||||
}
|
||||
|
||||
private void chromiumWebBrowser1_KeyDown(object sender, KeyEventArgs e)
|
||||
|
@ -189,16 +185,9 @@ namespace WebBrowser
|
|||
|
||||
private void chromiumWebBrowser1_LoadError(object sender, LoadErrorEventArgs e)
|
||||
{
|
||||
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "loaderror.html");
|
||||
fileUri2 = new Uri(filePath);
|
||||
string fileUrl = fileUri2.AbsoluteUri;
|
||||
}
|
||||
|
||||
private void bunifuImageButton2_Click(object sender, EventArgs e, frmSettings frmSettings)
|
||||
{
|
||||
string url = frmSettings.bunifuTextBox1.Text; // Get the URL from the text box on the form
|
||||
chromiumWebBrowser1.Load(url); // Navigate to the specified URL
|
||||
|
||||
// string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "loaderror.html");
|
||||
// _fileUri2 = new Uri(filePath);
|
||||
// string fileUrl = _fileUri2.AbsoluteUri;
|
||||
}
|
||||
|
||||
private void txtSearchOrUrl_KeyUp(object sender, KeyEventArgs e)
|
||||
|
|
8
WebBrowser/frmSettings.Designer.cs
generated
8
WebBrowser/frmSettings.Designer.cs
generated
|
@ -3,9 +3,9 @@ using System.Windows.Forms;
|
|||
using Bunifu.UI.WinForms;
|
||||
using Bunifu.UI.WinForms.BunifuButton;
|
||||
|
||||
namespace WebBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
partial class frmSettings
|
||||
partial class FrmSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
@ -37,7 +37,7 @@ namespace WebBrowser
|
|||
Bunifu.UI.WinForms.BunifuTextBox.StateProperties stateProperties10 = new Bunifu.UI.WinForms.BunifuTextBox.StateProperties();
|
||||
Bunifu.UI.WinForms.BunifuTextBox.StateProperties stateProperties11 = new Bunifu.UI.WinForms.BunifuTextBox.StateProperties();
|
||||
Bunifu.UI.WinForms.BunifuTextBox.StateProperties stateProperties12 = new Bunifu.UI.WinForms.BunifuTextBox.StateProperties();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSettings));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSettings));
|
||||
Bunifu.UI.WinForms.BunifuButton.BunifuButton2.BorderEdges borderEdges5 = new Bunifu.UI.WinForms.BunifuButton.BunifuButton2.BorderEdges();
|
||||
Bunifu.UI.WinForms.BunifuButton.BunifuButton2.BorderEdges borderEdges6 = new Bunifu.UI.WinForms.BunifuButton.BunifuButton2.BorderEdges();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
|
@ -1196,7 +1196,7 @@ namespace WebBrowser
|
|||
this.Controls.Add(this.bunifuLabel3);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "frmSettings";
|
||||
this.Name = "FrmSettings";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "frmSettings";
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
|
|
|
@ -1,27 +1,19 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using Bunifu.UI.WinForms;
|
||||
// using Bunifu.UI.WinForms;
|
||||
|
||||
namespace WebBrowser
|
||||
namespace XeroBrowser
|
||||
{
|
||||
public partial class frmSettings : Form
|
||||
public partial class FrmSettings : Form
|
||||
{
|
||||
public frmSettings()
|
||||
public FrmSettings()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
private void bunifuToggleSwitchflash_CheckedChanged(object sender, BunifuToggleSwitch.CheckedChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void bunifuToggleSwitchcookies_CheckedChanged(object sender, BunifuToggleSwitch.CheckedChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void bunifuDropdown1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -33,10 +25,6 @@ namespace WebBrowser
|
|||
Process.Start("ms-settings:network-proxy");
|
||||
}
|
||||
|
||||
private void frmSettings_FormClosing(object sender, FormClosingEventArgs e, Form form)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void bunifuPictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
|
Reference in a new issue