diff --git a/SLBr/SLBr/App.config b/SLBr/SLBr/App.config index 5754728..5ffd8f8 100644 --- a/SLBr/SLBr/App.config +++ b/SLBr/SLBr/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/SLBr/SLBr/App.xaml.cs b/SLBr/SLBr/App.xaml.cs index cf97143..2c102c4 100644 --- a/SLBr/SLBr/App.xaml.cs +++ b/SLBr/SLBr/App.xaml.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using System; using System.Collections.Generic; using System.Configuration; diff --git a/SLBr/SLBr/Favourite.cs b/SLBr/SLBr/Favourite.cs index bab64f7..08106da 100644 --- a/SLBr/SLBr/Favourite.cs +++ b/SLBr/SLBr/Favourite.cs @@ -1,16 +1,45 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SLBr { - public class Favourite + public class Favourite : INotifyPropertyChanged { - public string Name { get; set; } - public string Arguments { get; set; } + #region INotifyPropertyChanged + public event PropertyChangedEventHandler PropertyChanged = delegate { }; + + private void RaisePropertyChanged(string Name) + { + PropertyChanged(this, new PropertyChangedEventArgs(Name)); + } + #endregion + + public string Name + { + get { return DName; } + set + { + DName = value; + RaisePropertyChanged("Name"); + } + } + public string Arguments + { + get { return DArguments; } + set + { + DArguments = value; + RaisePropertyChanged("Arguments"); + } + } + + public string DName { get; set; } + public string DArguments { get; set; } } } diff --git a/SLBr/SLBr/FileAssociation.cs b/SLBr/SLBr/FileAssociation.cs index b9b69e0..474fe81 100644 --- a/SLBr/SLBr/FileAssociation.cs +++ b/SLBr/SLBr/FileAssociation.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using Microsoft.Win32; using System; using System.Collections.Generic; diff --git a/SLBr/SLBr/Handlers/ContextMenuHandler.cs b/SLBr/SLBr/Handlers/ContextMenuHandler.cs index da326f4..5baba13 100644 --- a/SLBr/SLBr/Handlers/ContextMenuHandler.cs +++ b/SLBr/SLBr/Handlers/ContextMenuHandler.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using CefSharp; using CefSharp.Wpf; @@ -22,14 +22,24 @@ public void OnBeforeContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser { if (!string.IsNullOrEmpty(parameters.SelectionText)) { - model.AddItem((CefMenuCommand)26501, "Search for text in new tab"); - model.AddSeparator(); - model.AddItem(CefMenuCommand.NotFound, "Close Menu"); - /*model.AddItem(CefMenuCommand.NotFound, "Close Menu"); - model.AddSeparator(); - model.Clear(); - model.AddItem(CefMenuCommand.Copy, "Copy"); - model.AddItem((CefMenuCommand)26501, "Save as");*/ + if (Utils.IsHttpScheme(parameters.SelectionText) || Utils.IsSchemeNotHttp(parameters.SelectionText)) + { + //model.Clear(); + model.AddItem((CefMenuCommand)26501, "Open in new tab"); + model.AddSeparator(); + model.AddItem(CefMenuCommand.NotFound, "Cancel"); + } + else + { + model.AddItem((CefMenuCommand)26501, "Search for text in new tab"); + model.AddSeparator(); + model.AddItem(CefMenuCommand.NotFound, "Cancel"); + /*model.AddItem(CefMenuCommand.NotFound, "Close Menu"); + model.AddSeparator(); + model.Clear(); + model.AddItem(CefMenuCommand.Copy, "Copy"); + model.AddItem((CefMenuCommand)26501, "Save as");*/ + } } else { @@ -37,8 +47,6 @@ public void OnBeforeContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser model.Remove(CefMenuCommand.ViewSource); model.AddItem(CefMenuCommand.Reload, "Refresh"); model.AddSeparator(); - model.AddItem(CefMenuCommand.NotFound, "Close Menu"); - model.AddSeparator(); model.AddItem((CefMenuCommand)26501, "Zoom In"); model.AddItem((CefMenuCommand)26502, "Zoom Out"); model.AddItem((CefMenuCommand)26503, "Reset Zoom Level"); @@ -59,15 +67,17 @@ public void OnBeforeContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser model.AddItem((CefMenuCommand)26507, "Search page on SafeBrowsing"); model.AddItem((CefMenuCommand)26504, "View page source"); model.AddItem((CefMenuCommand)26505, "Inspect"); + model.AddSeparator(); + model.AddItem(CefMenuCommand.NotFound, "Cancel"); } } else { - model.AddItem(CefMenuCommand.NotFound, "Close Menu"); - model.AddSeparator(); model.Clear(); model.AddItem(CefMenuCommand.Copy, "Copy"); model.AddItem((CefMenuCommand)26501, "Save as"); + model.AddSeparator(); + model.AddItem(CefMenuCommand.NotFound, "Cancel"); //model.AddItem((CefMenuCommand)26502, "Open in paintbrush"); } } @@ -83,8 +93,21 @@ public bool OnContextMenuCommand(IWebBrowser chromiumWebBrowser, IBrowser browse { if (!string.IsNullOrEmpty(SelectedText)) { - if (commandId == (CefMenuCommand)26501) - MainWindow.Instance.CreateTab(MainWindow.Instance.CreateWebBrowser(string.Format(MainWindow.Instance.MainSave.Get("Search_Engine"), SelectedText.Trim().Replace(" ", "+")))); + if (Utils.IsHttpScheme(SelectedText) || Utils.IsSchemeNotHttp(SelectedText)) + { + if (commandId == (CefMenuCommand)26501) + MainWindow.Instance.CreateTab(MainWindow.Instance.CreateWebBrowser(SelectedText)); + } + else + { + if (commandId == (CefMenuCommand)26501) + MainWindow.Instance.CreateTab(MainWindow.Instance.CreateWebBrowser(string.Format(MainWindow.Instance.MainSave.Get("Search_Engine"), SelectedText.Trim().Replace(" ", "+")))); + /*model.AddItem(CefMenuCommand.NotFound, "Close Menu"); + model.AddSeparator(); + model.Clear(); + model.AddItem(CefMenuCommand.Copy, "Copy"); + model.AddItem((CefMenuCommand)26501, "Save as");*/ + } } else { diff --git a/SLBr/SLBr/Handlers/DownloadHandler.cs b/SLBr/SLBr/Handlers/DownloadHandler.cs index 8dd291c..a12bc39 100644 --- a/SLBr/SLBr/Handlers/DownloadHandler.cs +++ b/SLBr/SLBr/Handlers/DownloadHandler.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using CefSharp; //using Microsoft.Win32; using System; @@ -81,11 +81,13 @@ public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, { if (downloadItem.IsComplete) { - MainWindow.Instance.DownloadProgressText.Visibility = Visibility.Collapsed; + /*MainWindow.Instance.DownloadProgressText.Visibility = Visibility.Collapsed; MainWindow.Instance.DownloadProgressBar.Visibility = Visibility.Collapsed; //browser.CloseBrowser(true); MainWindow.Instance.DownloadOpenFileButton.Visibility = Visibility.Visible; - MainWindow.Instance.DownloadOpenFileButton.Tag = $"13<,>{downloadItem.FullPath}"; + MainWindow.Instance.DownloadOpenFileButton.Tag = $"13<,>{downloadItem.FullPath}";*/ + MainWindow.Instance.DownloadContainer.Visibility = Visibility.Collapsed; + MainWindow.Instance.Prompt($"The file \"{Path.GetFileName(downloadItem.FullPath)}\" finished downloading.", true, "Open In Explorer", $"13<,>{downloadItem.FullPath}", downloadItem.FullPath, true, "\xE896"); } else { diff --git a/SLBr/SLBr/Handlers/JSBindingHandler.cs b/SLBr/SLBr/Handlers/JSBindingHandler.cs index ea05614..65ae46f 100644 --- a/SLBr/SLBr/Handlers/JSBindingHandler.cs +++ b/SLBr/SLBr/Handlers/JSBindingHandler.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using CefSharp; using System; using System.Collections.Generic; diff --git a/SLBr/SLBr/Handlers/JsDialogHandler.cs b/SLBr/SLBr/Handlers/JsDialogHandler.cs new file mode 100644 index 0000000..d5cee54 --- /dev/null +++ b/SLBr/SLBr/Handlers/JsDialogHandler.cs @@ -0,0 +1,40 @@ +using CefSharp; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SLBr +{ + public class JsDialogHandler : IJsDialogHandler + { + public bool OnBeforeUnloadDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string messageText, bool isReload, IJsDialogCallback callback) + { + return false; + } + + public void OnDialogClosed(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + } + + public bool OnJSDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage) + { + //Plan to override default dialog + + //Remove dialog from showing + //callback.Continue(true); + //return true; + + //Surpress dialog + //suppressMessage = true; + //return false; + + return false; + } + + public void OnResetDialogState(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + } + } +} diff --git a/SLBr/SLBr/Handlers/KeyboardHandler.cs b/SLBr/SLBr/Handlers/KeyboardHandler.cs index 8c5e575..b8f39e7 100644 --- a/SLBr/SLBr/Handlers/KeyboardHandler.cs +++ b/SLBr/SLBr/Handlers/KeyboardHandler.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using CefSharp; using System; using System.Collections.Generic; diff --git a/SLBr/SLBr/Handlers/LifeSpanHandler.cs b/SLBr/SLBr/Handlers/LifeSpanHandler.cs index 4e0f2e6..773df5f 100644 --- a/SLBr/SLBr/Handlers/LifeSpanHandler.cs +++ b/SLBr/SLBr/Handlers/LifeSpanHandler.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using CefSharp; using System; using System.Collections.Generic; diff --git a/SLBr/SLBr/Handlers/RequestHandler.cs b/SLBr/SLBr/Handlers/RequestHandler.cs index 2991f15..deb27de 100644 --- a/SLBr/SLBr/Handlers/RequestHandler.cs +++ b/SLBr/SLBr/Handlers/RequestHandler.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using CefSharp; using System; using System.Collections.Generic; @@ -24,7 +24,7 @@ public bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFr { if (request.Url.Contains("roblox.com")) return true; - if ((isRedirect || userGesture || frame.IsMain) && !Utils.IsSystemUrl(request.Url) && !Utils.IsProgramUrl(request.Url)) + if (Utils.CanCheck(request.TransitionType) && !Utils.IsSystemUrl(request.Url) && !Utils.IsProgramUrl(request.Url))//(isRedirect || userGesture || frame.IsMain) { string Response = MainWindow.Instance._SafeBrowsing.Response(request.Url.Replace("https://googleweblight.com/?lite_url=", "")); Utils.SafeBrowsing.ThreatType _ThreatType = Utils.CheckForInternetConnection() ? MainWindow.Instance._SafeBrowsing.GetThreatType(Response) : Utils.SafeBrowsing.ThreatType.Unknown; diff --git a/SLBr/SLBr/Handlers/ResourceRequestHandler.cs b/SLBr/SLBr/Handlers/ResourceRequestHandler.cs index 46e39b7..75e5e00 100644 --- a/SLBr/SLBr/Handlers/ResourceRequestHandler.cs +++ b/SLBr/SLBr/Handlers/ResourceRequestHandler.cs @@ -1,5 +1,5 @@ // Copyright © 2022 SLT World. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// Use of this source code is governed by a GNU license that can be found in the LICENSE file. using CefSharp; using Newtonsoft.Json.Linq; using System; @@ -37,6 +37,19 @@ public IResponseFilter GetResourceResponseFilter(IWebBrowser chromiumWebBrowser, public CefReturnValue OnBeforeResourceLoad(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback) { + /*try + { + if (Utils.CanCheck(request.TransitionType)) + { + if (Utils.CleanUrl(request.Url).Contains("facebook.com")) + request.SetHeaderByName("user-agent", MainWindow.Instance.UserAgent.Replace($"Chromium", "Chrome"), true); + else if (Utils.CleanUrl(request.Url).Contains("web.whatsapp.com")) + request.SetHeaderByName("user-agent", MainWindow.Instance.UserAgent.Replace($"Chromium", "Chrome"), true); + else if (Utils.CleanUrl(request.Url).Contains("mail.google.com") || Utils.CleanUrl(request.Url).Contains("web.whatsapp.com")) + request.SetHeaderByName("user-agent", MainWindow.Instance.UserAgent.Replace($"SLBr {MainWindow.Instance.ReleaseVersion}", "").Replace($"Chromium", "Chrome"), true); + } + } + catch { }*/ //Chrome Web Store Experiment //request.SetHeaderByName("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.62", false); //request.SetHeaderByName("sec-ch-ua", "\" Not A; Brand\";v=\"99\", \"Chromium\";v=\"98\", \"Microsoft Edge\";v=\"98\"", false); diff --git a/SLBr/SLBr/MainWindow.xaml b/SLBr/SLBr/MainWindow.xaml index 49ad10f..4e9148a 100644 --- a/SLBr/SLBr/MainWindow.xaml +++ b/SLBr/SLBr/MainWindow.xaml @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> + @@ -56,7 +57,6 @@ Use of this source code is governed by a BSD-style license that can be found in - @@ -64,46 +64,76 @@ Use of this source code is governed by a BSD-style license that can be found in - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + @@ -147,15 +176,15 @@ Use of this source code is governed by a BSD-style license that can be found in + + + + +
+
+ + +
+ +
+
+
+
+
+ + +
+ +
+
+
+
+
+ + +
+
@@ -63,19 +90,57 @@

Message from App diff --git a/SLBr/SLBr/Resources/Dino.html b/SLBr/SLBr/Resources/Dino.html index 699aba1..dd96bbc 100644 --- a/SLBr/SLBr/Resources/Dino.html +++ b/SLBr/SLBr/Resources/Dino.html @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> diff --git a/SLBr/SLBr/Resources/GeolocationTest.html b/SLBr/SLBr/Resources/GeolocationTest.html index 5c02028..c51d01b 100644 --- a/SLBr/SLBr/Resources/GeolocationTest.html +++ b/SLBr/SLBr/Resources/GeolocationTest.html @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> diff --git a/SLBr/SLBr/Resources/HTMLEditor.html b/SLBr/SLBr/Resources/HTMLEditor.html index 5da81eb..fd1cd1c 100644 --- a/SLBr/SLBr/Resources/HTMLEditor.html +++ b/SLBr/SLBr/Resources/HTMLEditor.html @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> diff --git a/SLBr/SLBr/Resources/License.html b/SLBr/SLBr/Resources/License.html index 7078fc6..9f4c5aa 100644 --- a/SLBr/SLBr/Resources/License.html +++ b/SLBr/SLBr/Resources/License.html @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> @@ -11,7 +11,7 @@
-// SLBr. The new, clean and lightweight .NET Web browser.
+// SLBr. The new, clean, lightweight .NET Web browser.
 // Copyright (C) 2022 SLT World
 //
 // This program is free software: you can redistribute it and/or modify
diff --git a/SLBr/SLBr/Resources/Malware.html b/SLBr/SLBr/Resources/Malware.html
index d7f7055..2e7d788 100644
--- a/SLBr/SLBr/Resources/Malware.html
+++ b/SLBr/SLBr/Resources/Malware.html
@@ -1,5 +1,5 @@
 
+Use of this source code is governed by a GNU license that can be found in the LICENSE file.-->
 
 
 
diff --git a/SLBr/SLBr/Resources/Plans.html b/SLBr/SLBr/Resources/Plans.html
index 3296223..3a927ca 100644
--- a/SLBr/SLBr/Resources/Plans.html
+++ b/SLBr/SLBr/Resources/Plans.html
@@ -1,5 +1,5 @@
 
+Use of this source code is governed by a GNU license that can be found in the LICENSE file.-->
 
 
 
diff --git a/SLBr/SLBr/Resources/SLBr-Urls.html b/SLBr/SLBr/Resources/SLBr-Urls.html
index 85a3c05..d5c192c 100644
--- a/SLBr/SLBr/Resources/SLBr-Urls.html
+++ b/SLBr/SLBr/Resources/SLBr-Urls.html
@@ -1,5 +1,5 @@
 
+Use of this source code is governed by a GNU license that can be found in the LICENSE file.-->
 
 
 
diff --git a/SLBr/SLBr/Resources/SLBrUADetector.html b/SLBr/SLBr/Resources/SLBrUADetector.html
index e174aa7..1be273e 100644
--- a/SLBr/SLBr/Resources/SLBrUADetector.html
+++ b/SLBr/SLBr/Resources/SLBrUADetector.html
@@ -1,5 +1,5 @@
 
+Use of this source code is governed by a GNU license that can be found in the LICENSE file.-->
 
 
 
diff --git a/SLBr/SLBr/Resources/Updates.html b/SLBr/SLBr/Resources/Updates.html
index cf17912..e5414ba 100644
--- a/SLBr/SLBr/Resources/Updates.html
+++ b/SLBr/SLBr/Resources/Updates.html
@@ -1,5 +1,5 @@
 
+Use of this source code is governed by a GNU license that can be found in the LICENSE file.-->
 
 
 
diff --git a/SLBr/SLBr/Resources/Urls.html b/SLBr/SLBr/Resources/Urls.html
index 986ec0d..331bd0d 100644
--- a/SLBr/SLBr/Resources/Urls.html
+++ b/SLBr/SLBr/Resources/Urls.html
@@ -1,5 +1,5 @@
 
+Use of this source code is governed by a GNU license that can be found in the LICENSE file.-->
 
 waa
 
@@ -19,6 +19,7 @@ 

List of SLBr Urls

  • slbr://about
  • slbr://version
  • slbr://license
  • +
  • slbr://credits
  • slbr://whatsnew
  • diff --git a/SLBr/SLBr/Resources/Version.html b/SLBr/SLBr/Resources/Version.html index 0a94a8f..1d72b3c 100644 --- a/SLBr/SLBr/Resources/Version.html +++ b/SLBr/SLBr/Resources/Version.html @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> diff --git a/SLBr/SLBr/Resources/Welcome.html b/SLBr/SLBr/Resources/Welcome.html index 035d990..aef916b 100644 --- a/SLBr/SLBr/Resources/Welcome.html +++ b/SLBr/SLBr/Resources/Welcome.html @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> diff --git a/SLBr/SLBr/Resources/WhatsNew.html b/SLBr/SLBr/Resources/WhatsNew.html index cfd65ed..430c93b 100644 --- a/SLBr/SLBr/Resources/WhatsNew.html +++ b/SLBr/SLBr/Resources/WhatsNew.html @@ -1,5 +1,5 @@  +Use of this source code is governed by a GNU license that can be found in the LICENSE file.--> @@ -7,7 +7,7 @@ About SLBr - +