Command Palette/Run search with Edge instead of default browser due to incomplete registry lookup
Microsoft PowerToys version
0.91.1
Installation method
GitHub
Area(s) with issue?
PowerToys Run, Command Palette
Steps to reproduce
Use web search via Command Palette or Run.
✔️ Expected Behavior
Should search with default browser
❌ Actual Behavior
Searches with Edge.
Requires a specific Windows configuration state to reproduce. No idea how to get it.
Additional Information
This issue has been reported multiple times, especially after changing default browsers:
- #16549
- #28527
- #32472
Usually specific users report having problems while everyone else says it works fine on their machine.
I've looked at the problem on my machine and figured it out.
It starts with not being able to find default browser info:
-------------------------- Begin exception --------------------------
Message: Exception when retrieving browser path/name. Path and Name are set to use Microsoft Edge.
Exception full name : System.ArgumentOutOfRangeException
Exception message : Default browser program command is not specified. (Parameter 'commandPattern')
Exception stack trace:
at Wox.Plugin.Common.DefaultBrowserInfo.Update()
Exception source : Wox.Plugin
Exception target site: Void Update()
Exception HResult : -2146233086
-------------------------- End exception --------------------------
I traced this to the file:
https://github.com/microsoft/PowerToys/blob/main/src/modules/launcher/Wox.Plugin/Common/DefaultBrowserInfo.cs
To find the default browser, this code looks up the registry value:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice/ProgId
However, on my machine, when I switch the default http handler, Windows instead writes to the following registry value:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoiceLatest\ProgId/(Default)
The normal ProgId value is also there but contains the ID of an old firefox installation. Windows and other programs seem to ignore it.
But Command Palette and Run use it to try to find another key in HKEY_CLASSES_ROOT to find out how to call the program.
In my case, that key doesn't exist, so the lookup fails and defaults to Edge
Fix
Locally I fixed the issue by copying some registry info to make sure the old key redirects to the current firefox installation.
But in the code, it can be fixed by looking up the UserChoiceLatest registry value.
Other Software
No response
We've found some similar issues:
- #39508 , similarity score: 82%
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
Note: You can give me feedback by 👍 or 👎 this comment.
I'm going to /dup https://github.com/microsoft/PowerToys/issues/39508
actually, /dup https://github.com/microsoft/PowerToys/issues/39794
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!