From a26c9069930ede919434759aed21c3e453348d53 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Thu, 17 Dec 2020 11:06:31 +0000 Subject: [PATCH 1/7] Extra logging for Videos #186 --- Logic/ApplicationSettings.cs | 2 +- Properties/AssemblyInfo.cs | 4 +-- Rendering/Region.xaml.cs | 4 ++- Rendering/Video.cs | 51 ++++++++++++++++++++++++++++++++---- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/Logic/ApplicationSettings.cs b/Logic/ApplicationSettings.cs index 1261e5bd..5ca6dee6 100644 --- a/Logic/ApplicationSettings.cs +++ b/Logic/ApplicationSettings.cs @@ -50,7 +50,7 @@ private static readonly Lazy /// private List ExcludedProperties; - public string ClientVersion { get; } = "2 R256.5"; + public string ClientVersion { get; } = "2 R256.6"; public string Version { get; } = "5"; public int ClientCodeVersion { get; } = 256; diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0d79e12c..766fb36d 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -49,6 +49,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.256.0.5")] -[assembly: AssemblyFileVersion("2.256.0.5")] +[assembly: AssemblyVersion("2.256.0.6")] +[assembly: AssemblyFileVersion("2.256.0.6")] [assembly: Guid("3bd467a4-4ef9-466a-b156-a79c13a863f7")] diff --git a/Rendering/Region.xaml.cs b/Rendering/Region.xaml.cs index fd011e0f..c3f83370 100644 --- a/Rendering/Region.xaml.cs +++ b/Rendering/Region.xaml.cs @@ -768,7 +768,7 @@ private void StopMedia(Media media) /// private void StopMedia(Media media, bool regionStopped) { - Trace.WriteLine(new LogMessage("Region", "StopMedia: Stopping..."), LogType.Audit.ToString()); + Trace.WriteLine(new LogMessage("Region", "StopMedia: " + media.Id + " stopping, region stopped " + regionStopped), LogType.Audit.ToString()); // Dispose of the current media try @@ -798,6 +798,8 @@ private void StopMedia(Media media, bool regionStopped) /// private void Media_MediaStoppedEvent(Media media) { + Trace.WriteLine(new LogMessage("Region", "Media_MediaStoppedEvent: " + media.Id), LogType.Audit.ToString()); + media.MediaStoppedEvent -= Media_MediaStoppedEvent; media.Stopped(); diff --git a/Rendering/Video.cs b/Rendering/Video.cs index 53be22c2..8a84cb8c 100644 --- a/Rendering/Video.cs +++ b/Rendering/Video.cs @@ -34,8 +34,20 @@ class Video : Media private bool _detectEnd = false; private bool isLooping = false; private readonly bool isFullScreenRequest = false; + + /// + /// Should this be visible? Audio sets this to false. + /// protected bool ShouldBeVisible { get; set; } + + /// + /// Muted? + /// protected bool Muted { get; set; } + + /// + /// Stretched? + /// protected bool Stretch { get; set; } /// @@ -54,6 +66,7 @@ class Video : Media /// public Video(RegionOptions options) : base(options) { + // Videos should be visible this.ShouldBeVisible = true; _filePath = Uri.UnescapeDataString(options.uri).Replace('+', ' '); @@ -79,10 +92,15 @@ public Video(RegionOptions options) : base(options) Stretch = options.Dictionary.Get("scaleType", "aspect").ToLowerInvariant() == "stretch"; } + /// + /// Media Failed + /// + /// + /// private void MediaElement_MediaFailed(object sender, ExceptionRoutedEventArgs e) { // Log and expire - Trace.WriteLine(new LogMessage("Video", "MediaElement_MediaFailed: Media Failed. E = " + e.ErrorException.Message), LogType.Error.ToString()); + Trace.WriteLine(new LogMessage("Video", "MediaElement_MediaFailed: " + this.Id + " Media Failed. E = " + e.ErrorException.Message), LogType.Error.ToString()); // Add this to a temporary blacklist so that we don't repeat it too quickly CacheManager.Instance.AddUnsafeItem(UnsafeItemType.Media, LayoutId, Id, "Video Failed: " + e.ErrorException.Message, 120); @@ -91,8 +109,15 @@ private void MediaElement_MediaFailed(object sender, ExceptionRoutedEventArgs e) Expired = true; } - private void MediaElement_MediaEnded(object sender, System.Windows.RoutedEventArgs e) + /// + /// Media Ended + /// + /// + /// + private void MediaElement_MediaEnded(object sender, RoutedEventArgs e) { + Trace.WriteLine(new LogMessage("Video", "MediaElement_MediaEnded: " + this.Id + " Ended, looping: " + isLooping), LogType.Audit.ToString()); + // Should we loop? if (isLooping) { @@ -112,6 +137,8 @@ private void MediaElement_MediaEnded(object sender, System.Windows.RoutedEventAr /// private void MediaElement_Loaded(object sender, RoutedEventArgs e) { + Trace.WriteLine(new LogMessage("Video", "MediaElement_Loaded: " + this.Id + " Loaded."), LogType.Audit.ToString()); + try { this.mediaElement.Play(); @@ -123,6 +150,10 @@ private void MediaElement_Loaded(object sender, RoutedEventArgs e) } } + /// + /// Render + /// + /// public override void RenderMedia(double position) { // Save the position @@ -134,7 +165,7 @@ public override void RenderMedia(double position) if (uri.IsFile && !File.Exists(_filePath)) { - Trace.WriteLine(new LogMessage("Video", "RenderMedia: File " + _filePath + " not found.")); + Trace.WriteLine(new LogMessage("Video", "RenderMedia: " + this.Id + ", File " + _filePath + " not found.")); throw new FileNotFoundException(); } @@ -144,12 +175,20 @@ public override void RenderMedia(double position) this.mediaElement.IsMuted = this.Muted; this.mediaElement.LoadedBehavior = MediaState.Manual; + // This is false if we're an audio module, otherwise video. if (!this.ShouldBeVisible) { this.mediaElement.Width = 0; this.mediaElement.Height = 0; this.mediaElement.Visibility = Visibility.Hidden; } + else + { + // Assert the Width/Height of the Parent + this.mediaElement.Width = Width; + this.mediaElement.Height = Height; + this.mediaElement.Visibility = Visibility.Visible; + } // Handle stretching if (Stretch) @@ -183,7 +222,7 @@ public override void RenderMedia(double position) this.MediaScene.Children.Add(this.mediaElement); - Trace.WriteLine(new LogMessage("Video", "RenderMedia: Video Started"), LogType.Audit.ToString()); + Trace.WriteLine(new LogMessage("Video", "RenderMedia: " + this.Id + ", added MediaElement and set source."), LogType.Audit.ToString()); } catch (Exception ex) { @@ -201,7 +240,7 @@ public override void RenderMedia(double position) /// private void MediaElement_MediaOpened(object sender, RoutedEventArgs e) { - Debug.WriteLine("MediaElement_MediaOpened", "Video"); + Trace.WriteLine(new LogMessage("Video", "MediaElement_MediaOpened: " + this.Id + " Opened, seek to: " + this._position), LogType.Audit.ToString()); // Try to seek if (this._position > 0) @@ -215,6 +254,8 @@ private void MediaElement_MediaOpened(object sender, RoutedEventArgs e) /// public override void Stopped() { + Trace.WriteLine(new LogMessage("Video", "Stopped: " + this.Id), LogType.Audit.ToString()); + // Remove the event handlers this.mediaElement.MediaOpened -= MediaElement_MediaOpened; this.mediaElement.Loaded -= MediaElement_Loaded; From 3d47a937d1286cffade801fb7a0cd4746bc5c315 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Fri, 18 Dec 2020 10:47:03 +0000 Subject: [PATCH 2/7] Potential fix for NTLM/Proxy #188 --- Helpers/ProxyRequestHandler.cs | 42 ++++++++++++++++++++++++++++++++++ MainWindow.xaml.cs | 10 ++++---- Rendering/WebCef.cs | 12 ++++++++++ XiboClient.csproj | 1 + 4 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 Helpers/ProxyRequestHandler.cs diff --git a/Helpers/ProxyRequestHandler.cs b/Helpers/ProxyRequestHandler.cs new file mode 100644 index 00000000..079da60d --- /dev/null +++ b/Helpers/ProxyRequestHandler.cs @@ -0,0 +1,42 @@ +/** + * Copyright (C) 2020 Xibo Signage Ltd + * + * Xibo - Digital Signage - http://www.xibo.org.uk + * + * This file is part of Xibo. + * + * Xibo is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Xibo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Xibo. If not, see . + */ +using CefSharp; +using CefSharp.Handler; + +namespace XiboClient.Helpers +{ + class ProxyRequestHandler : RequestHandler + { + protected override bool GetAuthCredentials(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback) + { + if (isProxy) + { + callback.Continue(ApplicationSettings.Default.ProxyUser, ApplicationSettings.Default.ProxyPassword); + + return true; + } + else + { + return false; + } + } + } +} diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index f9adeb81..75a2f456 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -327,10 +327,12 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e) CefSharp.CefSharpSettings.SubprocessExitIfParentProcessClosed = true; // Settings for Init - CefSharp.Wpf.CefSettings settings = new CefSharp.Wpf.CefSettings(); - settings.CachePath = ApplicationSettings.Default.LibraryPath + @"\CEF"; - settings.LogFile = ApplicationSettings.Default.LibraryPath + @"\CEF\cef.log"; - settings.LogSeverity = CefSharp.LogSeverity.Fatal; + CefSharp.Wpf.CefSettings settings = new CefSharp.Wpf.CefSettings + { + CachePath = ApplicationSettings.Default.LibraryPath + @"\CEF", + LogFile = ApplicationSettings.Default.LibraryPath + @"\CEF\cef.log", + LogSeverity = CefSharp.LogSeverity.Fatal + }; settings.CefCommandLineArgs["autoplay-policy"] = "no-user-gesture-required"; CefSharp.Cef.Initialize(settings); diff --git a/Rendering/WebCef.cs b/Rendering/WebCef.cs index 9f4cca4b..012f4fe7 100644 --- a/Rendering/WebCef.cs +++ b/Rendering/WebCef.cs @@ -51,6 +51,18 @@ public override void RenderMedia(double position) Name = "region_" + this.regionId }; + // Configure proxy, etc. + CefSharp.Cef.UIThreadTaskFactory.StartNew(() => { + // Do we have any auth service white lists + /*webView.RequestContext.SetPreference("auth.server_whitelist", "", out var error); + webView.RequestContext.SetPreference("auth.negotiate_delegate_whitelist", "", out var error2);*/ + + if (string.IsNullOrEmpty(ApplicationSettings.Default.ProxyUser)) + { + webView.RequestHandler = new ProxyRequestHandler(); + } + }); + webView.Visibility = System.Windows.Visibility.Hidden; webView.Loaded += WebView_Loaded; webView.LoadError += WebView_LoadError; diff --git a/XiboClient.csproj b/XiboClient.csproj index c6682343..11587180 100644 --- a/XiboClient.csproj +++ b/XiboClient.csproj @@ -118,6 +118,7 @@ + InfoScreen.xaml From b97d58b2ce777ef810c75152db4b84c59f959089 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Fri, 18 Dec 2020 11:41:57 +0000 Subject: [PATCH 3/7] Minor adjustments to video comments/logs Remove CEF SetPreference for NTLM until we can prove it works. --- Rendering/Video.cs | 19 +++++++++++++++---- Rendering/WebCef.cs | 15 ++++++--------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Rendering/Video.cs b/Rendering/Video.cs index 8a84cb8c..d8d084e2 100644 --- a/Rendering/Video.cs +++ b/Rendering/Video.cs @@ -131,13 +131,13 @@ private void MediaElement_MediaEnded(object sender, RoutedEventArgs e) } /// - /// Media is loaded + /// MediaElement has been added to the visual tree /// /// /// private void MediaElement_Loaded(object sender, RoutedEventArgs e) { - Trace.WriteLine(new LogMessage("Video", "MediaElement_Loaded: " + this.Id + " Loaded."), LogType.Audit.ToString()); + Trace.WriteLine(new LogMessage("Video", "MediaElement_Loaded: " + this.Id + " Control loaded, calling Play."), LogType.Audit.ToString()); try { @@ -146,7 +146,7 @@ private void MediaElement_Loaded(object sender, RoutedEventArgs e) catch (Exception ex) { // Problem calling play, we should expire. - Trace.WriteLine(new LogMessage("Video", "MediaElement_Loaded: Media Failed. E = " + ex.Message), LogType.Error.ToString()); + Trace.WriteLine(new LogMessage("Video", "MediaElement_Loaded: " + this.Id + " Media Failed. E = " + ex.Message), LogType.Error.ToString()); } } @@ -174,6 +174,7 @@ public override void RenderMedia(double position) this.mediaElement.Volume = this.volume; this.mediaElement.IsMuted = this.Muted; this.mediaElement.LoadedBehavior = MediaState.Manual; + this.mediaElement.UnloadedBehavior = MediaState.Close; // This is false if we're an audio module, otherwise video. if (!this.ShouldBeVisible) @@ -197,9 +198,16 @@ public override void RenderMedia(double position) } // Events + // MediaOpened is called after we've called Play() this.mediaElement.MediaOpened += MediaElement_MediaOpened; + + // Loaded is from the Framework and is called when the MediaElement is added to the visual tree (we call play in here) this.mediaElement.Loaded += MediaElement_Loaded; + + // Media ended is called when the media file has finished playing this.mediaElement.MediaEnded += MediaElement_MediaEnded; + + // Media Failed is called if the media file cannot be opened this.mediaElement.MediaFailed += MediaElement_MediaFailed; // Do we need to determine the end time ourselves? @@ -222,7 +230,7 @@ public override void RenderMedia(double position) this.MediaScene.Children.Add(this.mediaElement); - Trace.WriteLine(new LogMessage("Video", "RenderMedia: " + this.Id + ", added MediaElement and set source."), LogType.Audit.ToString()); + Trace.WriteLine(new LogMessage("Video", "RenderMedia: " + this.Id + ", added MediaElement and set source, detect end is " + _detectEnd), LogType.Audit.ToString()); } catch (Exception ex) { @@ -246,6 +254,9 @@ private void MediaElement_MediaOpened(object sender, RoutedEventArgs e) if (this._position > 0) { this.mediaElement.Position = TimeSpan.FromSeconds(this._position); + + // Set the position to 0, so that if we loop around again we start from the beginning + this._position = 0; } } diff --git a/Rendering/WebCef.cs b/Rendering/WebCef.cs index 012f4fe7..08c687be 100644 --- a/Rendering/WebCef.cs +++ b/Rendering/WebCef.cs @@ -51,17 +51,14 @@ public override void RenderMedia(double position) Name = "region_" + this.regionId }; - // Configure proxy, etc. - CefSharp.Cef.UIThreadTaskFactory.StartNew(() => { - // Do we have any auth service white lists - /*webView.RequestContext.SetPreference("auth.server_whitelist", "", out var error); - webView.RequestContext.SetPreference("auth.negotiate_delegate_whitelist", "", out var error2);*/ - - if (string.IsNullOrEmpty(ApplicationSettings.Default.ProxyUser)) + // Configure proxy + if (string.IsNullOrEmpty(ApplicationSettings.Default.ProxyUser)) + { + CefSharp.Cef.UIThreadTaskFactory.StartNew(() => { webView.RequestHandler = new ProxyRequestHandler(); - } - }); + }); + } webView.Visibility = System.Windows.Visibility.Hidden; webView.Loaded += WebView_Loaded; From 670f59ac4d1044eb41c38c92275f4933abcb6923 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Fri, 18 Dec 2020 12:50:19 +0000 Subject: [PATCH 4/7] Add a watchman for Videos which fail to call Opened/Failed event #186 --- Rendering/Video.cs | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Rendering/Video.cs b/Rendering/Video.cs index d8d084e2..afda9453 100644 --- a/Rendering/Video.cs +++ b/Rendering/Video.cs @@ -23,6 +23,7 @@ using System.IO; using System.Windows; using System.Windows.Controls; +using System.Windows.Threading; namespace XiboClient.Rendering { @@ -34,6 +35,7 @@ class Video : Media private bool _detectEnd = false; private bool isLooping = false; private readonly bool isFullScreenRequest = false; + private bool _openCalled = false; /// /// Should this be visible? Audio sets this to false. @@ -102,11 +104,14 @@ private void MediaElement_MediaFailed(object sender, ExceptionRoutedEventArgs e) // Log and expire Trace.WriteLine(new LogMessage("Video", "MediaElement_MediaFailed: " + this.Id + " Media Failed. E = " + e.ErrorException.Message), LogType.Error.ToString()); + // Failed is the opposite of open, but we mark this as open called so that our watchman doesn't also try to expire + this._openCalled = true; + // Add this to a temporary blacklist so that we don't repeat it too quickly CacheManager.Instance.AddUnsafeItem(UnsafeItemType.Media, LayoutId, Id, "Video Failed: " + e.ErrorException.Message, 120); // Expire - Expired = true; + SignalElapsedEvent(); } /// @@ -148,6 +153,28 @@ private void MediaElement_Loaded(object sender, RoutedEventArgs e) // Problem calling play, we should expire. Trace.WriteLine(new LogMessage("Video", "MediaElement_Loaded: " + this.Id + " Media Failed. E = " + ex.Message), LogType.Error.ToString()); } + + // We make a watchman to check that the video actually gets loaded. + var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(4) }; + timer.Tick += (timerSender, args) => + { + // You only tick once + timer.Stop(); + + // Check to see if open has been called. + if (!_openCalled) + { + Trace.WriteLine(new LogMessage("Video", "MediaElement_Loaded: " + this.Id + " Open not called after 4 seconds, marking unsafe and Expiring."), LogType.Error.ToString()); + + // Add this to a temporary blacklist so that we don't repeat it too quickly + CacheManager.Instance.AddUnsafeItem(UnsafeItemType.Media, LayoutId, Id, "Video Failed: Open not called after 4 seconds", 120); + + // Expire + SignalElapsedEvent(); + } + }; + + timer.Start(); } /// @@ -250,6 +277,9 @@ private void MediaElement_MediaOpened(object sender, RoutedEventArgs e) { Trace.WriteLine(new LogMessage("Video", "MediaElement_MediaOpened: " + this.Id + " Opened, seek to: " + this._position), LogType.Audit.ToString()); + // Open has been called. + this._openCalled = true; + // Try to seek if (this._position > 0) { From 21bd7341349c0a99cfeee908e715230426ce8e76 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Fri, 18 Dec 2020 17:45:08 +0000 Subject: [PATCH 5/7] Commands: new special command to close the main window, letting the watchdog restart. --- Action/Command.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Action/Command.cs b/Action/Command.cs index 302993e0..d073bdbb 100644 --- a/Action/Command.cs +++ b/Action/Command.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Windows; namespace XiboClient.Logic { @@ -40,6 +41,15 @@ public bool Run() return true; } } + else if (CommandString == "SoftRestart") + { + // Call close. + Application.Current.Dispatcher.Invoke(new System.Action(() => { + Application.Current.MainWindow.Close(); + })); + + return true; + } else { // Process with CMD From 8e7831605e703393da73d8fe1b78f5968eb45ff7 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Mon, 21 Dec 2020 09:29:04 +0000 Subject: [PATCH 6/7] Two new whitelists - auth server and edge browser. #188 --- Logic/ApplicationSettings.cs | 2 ++ Rendering/WebCef.cs | 27 +++++++++++++++++++++++---- Rendering/WebMedia.cs | 16 +++++++++++----- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/Logic/ApplicationSettings.cs b/Logic/ApplicationSettings.cs index 5ca6dee6..db49990d 100644 --- a/Logic/ApplicationSettings.cs +++ b/Logic/ApplicationSettings.cs @@ -456,6 +456,8 @@ public string ServerUri public string ClientInformationKeyCode { get; set; } public string XmrNetworkAddress { get; set; } public string AggregationLevel { get; set; } + public string AuthServerWhitelist { get; set; } + public string EdgeBrowserWhitelist { get; set; } // Download window public string DisplayTimeZone { get; set; } diff --git a/Rendering/WebCef.cs b/Rendering/WebCef.cs index 08c687be..84bf4bbb 100644 --- a/Rendering/WebCef.cs +++ b/Rendering/WebCef.cs @@ -51,12 +51,31 @@ public override void RenderMedia(double position) Name = "region_" + this.regionId }; - // Configure proxy - if (string.IsNullOrEmpty(ApplicationSettings.Default.ProxyUser)) + // Configure run time CEF settings? + if (!string.IsNullOrEmpty(ApplicationSettings.Default.AuthServerWhitelist) + || !string.IsNullOrEmpty(ApplicationSettings.Default.ProxyUser)) { CefSharp.Cef.UIThreadTaskFactory.StartNew(() => { - webView.RequestHandler = new ProxyRequestHandler(); + // NTLM/Auth Server White Lists. + if (!string.IsNullOrEmpty(ApplicationSettings.Default.AuthServerWhitelist)) + { + if (!webView.RequestContext.SetPreference("auth.server_whitelist", ApplicationSettings.Default.AuthServerWhitelist, out string error)) + { + Trace.WriteLine(new LogMessage("WebCef", "RenderMedia: auth.server_whitelist. e = " + error), LogType.Error.ToString()); + } + + if (!webView.RequestContext.SetPreference("auth.negotiate_delegate_whitelist", ApplicationSettings.Default.AuthServerWhitelist, out string error2)) + { + Trace.WriteLine(new LogMessage("WebCef", "RenderMedia: auth.negotiate_delegate_whitelist. e = " + error2), LogType.Error.ToString()); + } + } + + // Proxy + if (!string.IsNullOrEmpty(ApplicationSettings.Default.ProxyUser)) + { + webView.RequestHandler = new ProxyRequestHandler(); + } }); } @@ -115,7 +134,7 @@ private void WebView_Loaded(object sender, System.Windows.RoutedEventArgs e) private void WebView_LoadError(object sender, CefSharp.LoadErrorEventArgs e) { - Trace.WriteLine(new LogMessage("EdgeWebMedia", "Cannot navigate. e = " + e.ToString()), LogType.Error.ToString()); + Trace.WriteLine(new LogMessage("WebCef", "WebView_LoadError: Cannot navigate. e = " + e.ToString()), LogType.Error.ToString()); // This should exipre the media Duration = 5; diff --git a/Rendering/WebMedia.cs b/Rendering/WebMedia.cs index 5ffecbda..d9d9c4d0 100644 --- a/Rendering/WebMedia.cs +++ b/Rendering/WebMedia.cs @@ -472,16 +472,22 @@ public static string ReadBrowserType(string template) /// public static WebMedia GetConfiguredWebMedia(RegionOptions options) { - WebMedia media; if (ApplicationSettings.Default.FallbackToInternetExplorer) { - media = new WebIe(options); + return new WebIe(options); } - else + else if (!string.IsNullOrEmpty(ApplicationSettings.Default.EdgeBrowserWhitelist)) { - media = new WebCef(options); + // Decode the URL + string url = Uri.UnescapeDataString(options.uri); + + if (url.Contains(ApplicationSettings.Default.EdgeBrowserWhitelist)) + { + return new WebEdge(options); + } } - return media; + + return new WebCef(options); } /// From 307f6766f8289a1928410b79a18b1d1fc7e227f0 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Mon, 21 Dec 2020 10:42:48 +0000 Subject: [PATCH 7/7] Bump to R256.7 --- Logic/ApplicationSettings.cs | 2 +- Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Logic/ApplicationSettings.cs b/Logic/ApplicationSettings.cs index db49990d..a9694c7b 100644 --- a/Logic/ApplicationSettings.cs +++ b/Logic/ApplicationSettings.cs @@ -50,7 +50,7 @@ private static readonly Lazy /// private List ExcludedProperties; - public string ClientVersion { get; } = "2 R256.6"; + public string ClientVersion { get; } = "2 R256.7"; public string Version { get; } = "5"; public int ClientCodeVersion { get; } = 256; diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 766fb36d..9ec8b7b2 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -49,6 +49,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.256.0.6")] -[assembly: AssemblyFileVersion("2.256.0.6")] +[assembly: AssemblyVersion("2.256.0.7")] +[assembly: AssemblyFileVersion("2.256.0.7")] [assembly: Guid("3bd467a4-4ef9-466a-b156-a79c13a863f7")]