add beginnings to safe browsing integration

This commit is contained in:
RandomHuman 2023-06-25 16:33:44 -06:00
parent 4506a0d460
commit b74eca3d38
No known key found for this signature in database
GPG key ID: 6003A79AC08E8F3B
67 changed files with 100000 additions and 2 deletions

View file

@ -6,6 +6,11 @@ using Bunifu.Utils;
using CefSharp;
using CefSharp.WinForms;
using EasyTabs;
using Google.Apis.Safebrowsing.v4;
using Google.Apis.Safebrowsing.v4.Data;
using Google.Apis.Services;
using System.Collections.Generic;
using System.Threading.Tasks;
using XeroBrowser.Properties;
using static System.Net.WebRequestMethods;
// ReSharper disable PossibleNullReferenceException
@ -66,6 +71,21 @@ namespace XeroBrowser
private bool _isBlocked;
private void chromiumWebBrowser1_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
{
// chromiumWebBrowser1.LoadingStateChanged += async (s, args) =>
// {
// if (args.IsLoading)
// {
// var isUnsafe = await Program.IsUrlUnsafe(args.Browser.MainFrame.Url, "AIzaSyCQV-s52iNah-il6T5iFuqo6M_JzcLyaxs");
// if (isUnsafe)
// {
// chromiumWebBrowser1.Stop(); // cancel the navigation
// _isBlocked = true;
// chromiumWebBrowser1.LoadHtml("");
// break;
// }
// }
// };
if (e.IsLoading)
{
loadingIndicator.Visible = true;