fix every last warning in every last file (non-html at least)

This commit is contained in:
RandomHuman 2023-02-20 03:59:04 -07:00
parent dc5d26d13e
commit f7eef416d9
14 changed files with 154 additions and 189 deletions

View file

@ -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)