├── .gitattributes
├── .gitignore
├── AUTHORS
├── EdgeDeflector.sln
├── EdgeDeflector
├── App.config
├── EdgeDeflector.csproj
├── Icon.ico
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── resources
│ ├── nsis_installer.nsi
│ └── test-links.txt
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
3 | *.cs diff=csharp
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # User-specific files
2 | *.suo
3 | *.user
4 | *.userosscache
5 | *.sln.docstates
6 |
7 | # Build results
8 | [Dd]ebug/
9 | [Dd]ebugPublic/
10 | [Rr]elease/
11 | [Rr]eleases/
12 | x64/
13 | x86/
14 | bld/
15 | [Bb]in/
16 | [Oo]bj/
17 | [Ll]og/
18 |
19 | # Visual Studio 2015 cache/options directory
20 | .vs/
21 |
22 | # MSTest test Results
23 | [Tt]est[Rr]esult*/
24 | [Bb]uild[Ll]og.*
25 |
26 | # NUNIT
27 | *.VisualState.xml
28 | TestResult.xml
29 |
30 | # Build Results of an ATL Project
31 | [Dd]ebugPS/
32 | [Rr]eleasePS/
33 | dlldata.c
34 |
35 | # DNX
36 | project.lock.json
37 | project.fragment.lock.json
38 | artifacts/
39 |
40 | *_i.c
41 | *_p.c
42 | *_i.h
43 | *.ilk
44 | *.meta
45 | *.obj
46 | *.pch
47 | *.pdb
48 | *.pgc
49 | *.pgd
50 | *.rsp
51 | *.sbr
52 | *.tlb
53 | *.tli
54 | *.tlh
55 | *.tmp
56 | *.tmp_proj
57 | *.log
58 | *.vspscc
59 | *.vssscc
60 | .builds
61 | *.pidb
62 | *.svclog
63 | *.scc
64 |
65 | # Chutzpah Test files
66 | _Chutzpah*
67 |
68 | # Visual C++ cache files
69 | ipch/
70 | *.aps
71 | *.ncb
72 | *.opendb
73 | *.opensdf
74 | *.sdf
75 | *.cachefile
76 | *.VC.db
77 | *.VC.VC.opendb
78 |
79 | # Visual Studio profiler
80 | *.psess
81 | *.vsp
82 | *.vspx
83 | *.sap
84 |
85 | # TFS 2012 Local Workspace
86 | $tf/
87 |
88 | # Guidance Automation Toolkit
89 | *.gpState
90 |
91 | # ReSharper is a .NET coding add-in
92 | _ReSharper*/
93 | *.[Rr]e[Ss]harper
94 | *.DotSettings.user
95 |
96 | # JustCode is a .NET coding add-in
97 | .JustCode
98 |
99 | # TeamCity is a build add-in
100 | _TeamCity*
101 |
102 | # DotCover is a Code Coverage Tool
103 | *.dotCover
104 |
105 | # NCrunch
106 | _NCrunch_*
107 | .*crunch*.local.xml
108 | nCrunchTemp_*
109 |
110 | # MightyMoose
111 | *.mm.*
112 | AutoTest.Net/
113 |
114 | # Web workbench (sass)
115 | .sass-cache/
116 |
117 | # Installshield output folder
118 | [Ee]xpress/
119 |
120 | # DocProject is a documentation generator add-in
121 | DocProject/buildhelp/
122 | DocProject/Help/*.HxT
123 | DocProject/Help/*.HxC
124 | DocProject/Help/*.hhc
125 | DocProject/Help/*.hhk
126 | DocProject/Help/*.hhp
127 | DocProject/Help/Html2
128 | DocProject/Help/html
129 |
130 | # Click-Once directory
131 | publish/
132 |
133 | # Publish Web Output
134 | *.[Pp]ublish.xml
135 | *.azurePubxml
136 | # TODO: Comment the next line if you want to checkin your web deploy settings
137 | # but database connection strings (with potential passwords) will be unencrypted
138 | #*.pubxml
139 | *.publishproj
140 |
141 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
142 | # checkin your Azure Web App publish settings, but sensitive information contained
143 | # in these scripts will be unencrypted
144 | PublishScripts/
145 |
146 | # NuGet Packages
147 | *.nupkg
148 | # The packages folder can be ignored because of Package Restore
149 | **/packages/*
150 | # except build/, which is used as an MSBuild target.
151 | !**/packages/build/
152 | # Uncomment if necessary however generally it will be regenerated when needed
153 | #!**/packages/repositories.config
154 | # NuGet v3's project.json files produces more ignoreable files
155 | *.nuget.props
156 | *.nuget.targets
157 |
158 | # Microsoft Azure Build Output
159 | csx/
160 | *.build.csdef
161 |
162 | # Microsoft Azure Emulator
163 | ecf/
164 | rcf/
165 |
166 | # Windows Store app package directories and files
167 | AppPackages/
168 | BundleArtifacts/
169 | Package.StoreAssociation.xml
170 | _pkginfo.txt
171 |
172 | # Visual Studio cache files
173 | # files ending in .cache can be ignored
174 | *.[Cc]ache
175 | # but keep track of directories ending in .cache
176 | !*.[Cc]ache/
177 |
178 | # Others
179 | ClientBin/
180 | ~$*
181 | *~
182 | *.dbmdl
183 | *.dbproj.schemaview
184 | *.jfm
185 | *.pfx
186 | *.publishsettings
187 | node_modules/
188 | orleans.codegen.cs
189 |
190 | # Since there are multiple workflows, uncomment next line to ignore bower_components
191 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
192 | #bower_components/
193 |
194 | # RIA/Silverlight projects
195 | Generated_Code/
196 |
197 | # Backup & report files from converting an old project file
198 | # to a newer Visual Studio version. Backup files are not needed,
199 | # because we have git ;-)
200 | _UpgradeReport_Files/
201 | Backup*/
202 | UpgradeLog*.XML
203 | UpgradeLog*.htm
204 |
205 | # SQL Server files
206 | *.mdf
207 | *.ldf
208 |
209 | # Business Intelligence projects
210 | *.rdl.data
211 | *.bim.layout
212 | *.bim_*.settings
213 |
214 | # Microsoft Fakes
215 | FakesAssemblies/
216 |
217 | # GhostDoc plugin setting file
218 | *.GhostDoc.xml
219 |
220 | # Node.js Tools for Visual Studio
221 | .ntvs_analysis.dat
222 |
223 | # Visual Studio 6 build log
224 | *.plg
225 |
226 | # Visual Studio 6 workspace options file
227 | *.opt
228 |
229 | # Visual Studio LightSwitch build output
230 | **/*.HTMLClient/GeneratedArtifacts
231 | **/*.DesktopClient/GeneratedArtifacts
232 | **/*.DesktopClient/ModelManifest.xml
233 | **/*.Server/GeneratedArtifacts
234 | **/*.Server/ModelManifest.xml
235 | _Pvt_Extensions
236 |
237 | # Paket dependency manager
238 | .paket/paket.exe
239 | paket-files/
240 |
241 | # FAKE - F# Make
242 | .fake/
243 |
244 | # JetBrains Rider
245 | .idea/
246 | *.sln.iml
247 |
248 | # CodeRush
249 | .cr/
250 |
251 | # Python Tools for Visual Studio (PTVS)
252 | __pycache__/
253 | *.pyc
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | Daniel Aleksandersen (da2x)
2 | Mark Young (tip2tail)
3 |
4 | Search Engine Functionality:
5 | RadialApps (radialapps)
--------------------------------------------------------------------------------
/EdgeDeflector.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26206.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EdgeDeflector", "EdgeDeflector\EdgeDeflector.csproj", "{64E191BC-E8CE-4190-939E-C77A75AA0E28}"
7 | EndProject
8 | Global
9 | GlobalSection(Performance) = preSolution
10 | HasPerformanceSessions = true
11 | EndGlobalSection
12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 | Debug|Any CPU = Debug|Any CPU
14 | Release|Any CPU = Release|Any CPU
15 | EndGlobalSection
16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
17 | {64E191BC-E8CE-4190-939E-C77A75AA0E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18 | {64E191BC-E8CE-4190-939E-C77A75AA0E28}.Debug|Any CPU.Build.0 = Debug|Any CPU
19 | {64E191BC-E8CE-4190-939E-C77A75AA0E28}.Release|Any CPU.ActiveCfg = Release|Any CPU
20 | {64E191BC-E8CE-4190-939E-C77A75AA0E28}.Release|Any CPU.Build.0 = Release|Any CPU
21 | EndGlobalSection
22 | GlobalSection(SolutionProperties) = preSolution
23 | HideSolutionNode = FALSE
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/EdgeDeflector/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/EdgeDeflector/EdgeDeflector.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {64E191BC-E8CE-4190-939E-C77A75AA0E28}
8 | WinExe
9 | EdgeDeflector
10 | EdgeDeflector
11 | v4.6
12 | 512
13 | true
14 |
15 | publish\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | false
29 | true
30 |
31 |
32 | AnyCPU
33 | true
34 | full
35 | true
36 | bin\Debug\
37 | DEBUG;TRACE
38 | prompt
39 | 4
40 | false
41 | true
42 |
43 |
44 | AnyCPU
45 | pdbonly
46 | true
47 | bin\Release\
48 | TRACE
49 | prompt
50 | 4
51 | false
52 | true
53 |
54 |
55 | EdgeDeflector.Program
56 |
57 |
58 | Icon.ico
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | False
82 | Microsoft .NET Framework 4.6 %28x86 and x64%29
83 | true
84 |
85 |
86 | False
87 | .NET Framework 3.5 SP1
88 | false
89 |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/EdgeDeflector/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pulsejet/EdgeAndBingDeflector/bcea4d7608b3035c9d53bb0270a7f5122eddf1d5/EdgeDeflector/Icon.ico
--------------------------------------------------------------------------------
/EdgeDeflector/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2017 Daniel Aleksandersen
3 | * SPDX-License-Identifier: MIT
4 | * License-Filename: LICENSE
5 | */
6 |
7 | using Microsoft.Win32;
8 | using System;
9 | using System.Collections.Specialized;
10 | using System.Diagnostics;
11 | using System.Security.Principal;
12 | using System.Text.RegularExpressions;
13 | using System.Windows.Forms;
14 | using System.Web;
15 |
16 | namespace EdgeDeflector
17 | {
18 | class Program
19 | {
20 | static bool IsElevated()
21 | {
22 | return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
23 | }
24 |
25 | private static void ElevatePermissions()
26 | {
27 | ProcessStartInfo rerun = new ProcessStartInfo()
28 | {
29 | FileName = System.Reflection.Assembly.GetExecutingAssembly().Location,
30 | UseShellExecute = true,
31 | Verb = "runas"
32 | };
33 | Process.Start(rerun);
34 | }
35 |
36 | private static void RegisterProtocolHandler()
37 | {
38 | RegistryKey engine_key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Clients\EdgeUriDeflector", true);
39 | if (engine_key == null)
40 | {
41 | engine_key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Clients\EdgeUriDeflector", true);
42 | }
43 |
44 | DialogResult res = MessageBox.Show("Would you like to divert Bing to a different search engine?", "Edge Deflector",MessageBoxButtons.YesNo);
45 | if(res==DialogResult.Yes)
46 | {
47 | DialogResult res2 = MessageBox.Show("Press Yes for Google and No for DuckDuckGo", "Edge Deflector", MessageBoxButtons.YesNo);
48 | if (res2 == DialogResult.Yes) engine_key.SetValue("SearchEngine", "Google");
49 | else engine_key.SetValue("SearchEngine", "DuckDuckGo");
50 | }
51 | else engine_key.SetValue("SearchEngine", "Bing");
52 |
53 | RegistryKey uriclass_key = Registry.ClassesRoot.OpenSubKey("EdgeUriDeflector", true);
54 | if (uriclass_key == null)
55 | {
56 | uriclass_key = Registry.ClassesRoot.CreateSubKey("EdgeUriDeflector", true);
57 | }
58 |
59 | uriclass_key.SetValue(string.Empty, "URL: Microsoft Edge Protocol Deflector");
60 |
61 | RegistryKey icon_key = uriclass_key.OpenSubKey("DefaultIcon", true);
62 | if (icon_key == null)
63 | {
64 | icon_key = uriclass_key.CreateSubKey("DefaultIcon");
65 | }
66 |
67 | string exec_path = System.Reflection.Assembly.GetExecutingAssembly().Location;
68 |
69 | icon_key.SetValue(string.Empty, exec_path + ",0");
70 | icon_key.Close();
71 |
72 | RegistryKey shellcmd_key = uriclass_key.OpenSubKey(@"shell\open\command", true);
73 | if (shellcmd_key == null)
74 | {
75 | shellcmd_key = uriclass_key.CreateSubKey(@"shell\open\command");
76 | }
77 |
78 | shellcmd_key.SetValue(string.Empty, exec_path + " \"%1\"");
79 | shellcmd_key.Close();
80 |
81 | uriclass_key.SetValue("URL Protocol", string.Empty);
82 |
83 | uriclass_key.Close();
84 |
85 | RegistryKey software_key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Clients\EdgeUriDeflector", true);
86 | if (software_key == null)
87 | {
88 | software_key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Clients\EdgeUriDeflector", true);
89 | }
90 |
91 | RegistryKey capability_key = software_key.OpenSubKey("Capabilities", true);
92 | if (capability_key == null)
93 | {
94 | capability_key = software_key.CreateSubKey("Capabilities", true);
95 | }
96 |
97 | capability_key.SetValue("ApplicationDescription", "Open web links normally forced to open in Microsoft Edge in your default web browser.");
98 | capability_key.SetValue("ApplicationName", "EdgeDeflector");
99 |
100 | RegistryKey urlass_key = capability_key.OpenSubKey("UrlAssociations", true);
101 | if (urlass_key == null)
102 | {
103 | urlass_key = capability_key.CreateSubKey("UrlAssociations", true);
104 | }
105 |
106 | urlass_key.SetValue("microsoft-edge", "EdgeUriDeflector");
107 | urlass_key.Close();
108 |
109 | capability_key.Close();
110 | software_key.Close();
111 |
112 | RegistryKey registeredapps_key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\RegisteredApplications", true);
113 | registeredapps_key.SetValue("EdgeUriDeflector", @"SOFTWARE\Clients\EdgeUriDeflector\Capabilities");
114 | registeredapps_key.Close();
115 | }
116 |
117 | static bool IsUri(string uristring)
118 | {
119 | try
120 | {
121 | Uri uri = new Uri(uristring);
122 | return uri.IsWellFormedOriginalString();
123 | }
124 | catch (System.UriFormatException)
125 | {
126 | return false;
127 | }
128 | catch (ArgumentNullException)
129 | {
130 | return false;
131 | }
132 | }
133 |
134 | static bool IsHttpUri(string uri)
135 | {
136 | uri = uri.ToLower();
137 | return uri.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || uri.StartsWith("https://", StringComparison.OrdinalIgnoreCase);
138 | }
139 |
140 | static bool IsMsEdgeUri(string uri)
141 | {
142 | uri = uri.ToLower();
143 | return uri.StartsWith("microsoft-edge:", StringComparison.OrdinalIgnoreCase) && !uri.Contains(" ");
144 | }
145 |
146 | static bool IsNonAuthoritativeWithUrlQueryParameter(string uri)
147 | {
148 | return uri.Contains("microsoft-edge:?") && uri.Contains("&url=");
149 | }
150 |
151 | static string GetURIFromCortanaLink(string uri)
152 | {
153 | NameValueCollection queryCollection = HttpUtility.ParseQueryString(uri);
154 | return queryCollection["url"];
155 | }
156 |
157 | static string RewriteMsEdgeUriSchema(string uri)
158 | {
159 | RegistryKey engine_key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Clients\EdgeUriDeflector", true);
160 |
161 | string engine = (string) engine_key.GetValue("SearchEngine");
162 | string msedge_protocol_pattern = "^microsoft-edge:/*";
163 |
164 | Regex rgx = new Regex(msedge_protocol_pattern);
165 | string new_uri = rgx.Replace(uri, string.Empty);
166 |
167 | if (IsHttpUri(new_uri))
168 | {
169 | return replaceSearchEngine(new_uri, engine);
170 | }
171 |
172 | // May be new-style Cortana URI - try and split out
173 | if (IsNonAuthoritativeWithUrlQueryParameter(uri))
174 | {
175 | string cortanaUri = GetURIFromCortanaLink(uri);
176 | if (IsHttpUri(cortanaUri))
177 | {
178 | // Correctly form the new URI before returning
179 | return replaceSearchEngine(cortanaUri, engine);
180 | }
181 | }
182 |
183 | // defer fallback to web browser
184 | return "http://" + replaceSearchEngine(new_uri, engine);
185 | }
186 |
187 | static string replaceSearchEngine(string new_uri, string engine)
188 | {
189 | int index = new_uri.IndexOf("&");
190 | if (index > 0) new_uri = new_uri.Substring(0, index);
191 |
192 | if (engine == "Google")
193 | {
194 | return new_uri.Replace("bing.com/search?q=", "google.com/search?q=");
195 | }
196 | else if (engine == "DuckDuckGo")
197 | {
198 | return new_uri.Replace("bing.com/search?q=", "duckduckgo.com/?q=");
199 | }
200 |
201 | return new_uri;
202 | }
203 |
204 | static void OpenUri(string uri)
205 | {
206 | if (!IsUri(uri) || !IsHttpUri(uri))
207 | {
208 | Environment.Exit(1);
209 | }
210 |
211 | ProcessStartInfo launcher = new ProcessStartInfo()
212 | {
213 | FileName = uri,
214 | UseShellExecute = true
215 | };
216 | Process.Start(launcher);
217 | }
218 |
219 | static void Main(string[] args)
220 | {
221 | // Assume argument is URI
222 | if (args.Length == 1 && IsMsEdgeUri(args[0]))
223 | {
224 | string uri = RewriteMsEdgeUriSchema(args[0]);
225 | OpenUri(uri);
226 | }
227 |
228 | // Install when running without argument
229 | else if (args.Length == 0 || args.Equals(null))
230 | {
231 | if (!IsElevated())
232 | {
233 | ElevatePermissions();
234 | }
235 | else
236 | {
237 | RegisterProtocolHandler();
238 | }
239 | }
240 | }
241 | }
242 | }
--------------------------------------------------------------------------------
/EdgeDeflector/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EdgeDeflector")]
9 | [assembly: AssemblyDescription("Rewrites microsoft-edge URI addresses into standard http URI addresses.")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EdgeDeflector")]
13 | [assembly: AssemblyCopyright("Copyright © 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("64e191bc-e8ce-4190-939e-c77a75aa0e28")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Maintenance Number
30 | // Build Number
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.1.3.0")]
36 | [assembly: AssemblyFileVersion("1.1.3.0")]
37 |
--------------------------------------------------------------------------------
/EdgeDeflector/resources/nsis_installer.nsi:
--------------------------------------------------------------------------------
1 | ; Installer for EdgeDeflector
2 |
3 | ;--------------------------------
4 |
5 | !define PRODUCT "EdgeDeflector"
6 |
7 | Name "${PRODUCT} Installer"
8 |
9 | OutFile "..\bin\Release\${PRODUCT}_install.exe"
10 |
11 | ; Default installation directory
12 | InstallDir $PROGRAMFILES\${PRODUCT}
13 |
14 | ; Store install dir in the registry
15 | InstallDirRegKey HKLM "Software\${PRODUCT}" "Install_Dir"
16 |
17 | ; Request application privileges for UAC
18 | RequestExecutionLevel admin
19 |
20 |
21 | ;--------------------------------
22 |
23 | ; Installer pages
24 | Page directory
25 | Page instfiles
26 |
27 | ; Uninstaller pages
28 | UninstPage uninstConfirm
29 | UninstPage instfiles
30 |
31 | ;--------------------------------
32 |
33 |
34 | Section "Installer"
35 |
36 | ; Set output path to the installation directory.
37 | SetOutPath $INSTDIR
38 |
39 | ; Put file there
40 | File ..\bin\Release\EdgeDeflector.exe
41 |
42 | ; Self-registeres to the registry
43 | ExecWait '$INSTDIR\${PRODUCT}.exe'
44 |
45 | ; Write the installation path to the registry
46 | WriteRegStr HKLM SOFTWARE\${PRODUCT} "Install_Dir" "$INSTDIR"
47 |
48 | ; Write the uninstall keys to the registry
49 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayName" "${PRODUCT}"
50 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "UninstallString" '"$INSTDIR\${PRODUCT}_uninstall.exe"'
51 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "NoModify" 1
52 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "NoRepair" 1
53 | WriteUninstaller "${PRODUCT}_uninstall.exe"
54 |
55 | ExecShell "open" "microsoft-edge:https://github.com/da2x/EdgeDeflector/wiki/Thank-you-for-installing-EdgeDeflector"
56 |
57 | SectionEnd
58 |
59 | ;--------------------------------
60 |
61 |
62 | Section "Uninstall"
63 |
64 | ; Remove registry keys
65 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}"
66 | DeleteRegKey HKLM SOFTWARE\${PRODUCT}
67 |
68 | ; Remove files and uninstaller
69 | Delete $INSTDIR\${PRODUCT}.exe
70 | Delete $INSTDIR\${PRODUCT}_uninstall.exe
71 |
72 | SectionEnd
73 |
--------------------------------------------------------------------------------
/EdgeDeflector/resources/test-links.txt:
--------------------------------------------------------------------------------
1 | microsoft-edge:https://www.example.com/
2 | microsoft-edge://https://www.example.com/
3 | microsoft-edge:https://www.example.com/?url=https%3A%2F%2Fwww.example.net%2F
4 | microsoft-edge:?launchContext1=Microsoft.Windows.Cortana_cw5n1h2txyewy&url=https%3A%2F%2Fwww.example.com%2F
5 | microsoft-edge://?launchContext1=Microsoft.Windows.Cortana_cw5n1h2txyewy&url=https%3A%2F%2Fwww.example.com%2%3Furl%3Dhttps%253A%252F%252Fwww.example.net%252F
6 | microsoft-edge:?launchContext1=TimelineActivityId&launchContext2=5a1c4c0f-0f36-4942-8612-ba551bee378a&url=https%3A%2F%2Fwww.example.com%2F
7 | microsoft-edge:https://www.example.com/?url=https%3A%2F%2Fwww.example.net%2F
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright © 2017 Daniel Aleksandersen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EdgeAndBingDeflector
2 |
3 | *EdgeAndBingDeflector* is a small helper application that intercepts URIs that force-open web links in Microsoft Edge and redirects it to the system’s default web browser, along with changing the search engine to Google or DuckDuckGo if necessary. This allows you to use Windows features like the Cortana assistant and built-in help links with the browser of your choice instead of being forced to use Microsoft Edge. With EdgeAndBingDefelctor, you’re free to use Firefox, Google Chrome, along with your favorite search engine!
4 |
5 | You’ll never see EdgeAndBingDeflector ever again after installing it. It does its thing transparently in the background and only runs when a link needs to be deflected away from Microsoft Edge.
6 |
7 | System requirements: Windows 10, and your favorite web browser.
8 |
9 | Read more about [how EdgeAndBingDeflector works](https://www.ctrl.blog/entry/edgedeflector-default-browser) and why it was created.
10 |
11 | # Installation
12 |
13 | 1. **Download** the latest version of EdgeAndBingDeflector from [GitHub releases](https://github.com/radialapps/EdgeAndBingDeflector/releases)
14 | 2. Run the installer once to configure your system
15 |
16 | You may need to **repeat the above steps after installing major feature updates to Windows** through Windows Update. You can subscribe to the [AppCast feed](https://github.com/radialapps/EdgeAndBingDeflector/releases.atom) to be notified of any new releases.
17 |
18 | If you dismiss the initial dialog to choose to use EdgeAndBingDeflector, or choose the wrong app; you can apply the change in the Windows Settings app: Apps: Default apps: Choose default apps by protocol: microsoft-edge.
19 |
20 | If EdgeAndBingDeflector isn’t listed in either locations, try running it one more time; or lastly restarting your PC before you try again. (This last option actually helps if the System Registry is locked up or Windows is being stubborn.)
21 |
22 | You don’t need to specify your browser of choice in EdgeAndBingDeflector. It will pick up on the system configured default from Windows Settings app: Apps: Default apps: Web browser.
23 |
24 | # FAQ
25 |
26 | ## “Intercepting links” sounds like it would affect my privacy?
27 |
28 | Yes it does, but no. Everything is done on your local computer. EdgeAndBingDeflector rewrites links which are forced by the Windows shell to open inside Microsoft Edge to open using your default web browser instead. No data is collected about you nor even stored on your local computer.
29 |
30 | ## How do I uninstall EdgeAndBingDeflector?
31 |
32 | By following [these instructions](https://github.com/da2x/EdgeDeflector/wiki/Uninstall).
--------------------------------------------------------------------------------