From 459f2571c1f714a88ac33f128de4b8a6c862c68f Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Sat, 29 Jul 2017 21:47:01 +0200 Subject: [PATCH] Replace IsNewCortanaURI with IsNonAuthoritativeWithUrlQueryParameter Rewrite conditional to check that required url query parameter is included, and make it support other launch contexts with a generalized test for a non- authoritative microsoft-edge: URI. --- EdgeDeflector/Program.cs | 6 +++--- EdgeDeflector/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/EdgeDeflector/Program.cs b/EdgeDeflector/Program.cs index 24470b6..641d719 100644 --- a/EdgeDeflector/Program.cs +++ b/EdgeDeflector/Program.cs @@ -121,9 +121,9 @@ static bool IsMsEdgeUri(string uri) return uri.StartsWith("microsoft-edge:", StringComparison.OrdinalIgnoreCase) && !uri.Contains(" "); } - static bool IsNewCortanaURI(string uri) + static bool IsNonAuthoritativeWithUrlQueryParameter(string uri) { - return uri.Contains("launchContext1=Microsoft.Windows.Cortana"); + return uri.Contains("microsoft-edge:?") && uri.Contains("&url="); } static string GetURIFromCortanaLink(string uri) @@ -151,7 +151,7 @@ static string RewriteMsEdgeUriSchema(string uri) } // May be new-style Cortana URI - try and split out - if (IsNewCortanaURI(uri)) + if (IsNonAuthoritativeWithUrlQueryParameter(uri)) { string cortanaUri = GetURIFromCortanaLink(uri); if (IsHttpUri(cortanaUri)) diff --git a/EdgeDeflector/Properties/AssemblyInfo.cs b/EdgeDeflector/Properties/AssemblyInfo.cs index a9e0122..d32c0d0 100644 --- a/EdgeDeflector/Properties/AssemblyInfo.cs +++ b/EdgeDeflector/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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("1.0.1.0")] -[assembly: AssemblyFileVersion("1.0.1.0")] +[assembly: AssemblyVersion("1.1.1.0")] +[assembly: AssemblyFileVersion("1.1.1.0")]