Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Fixed default browser setting reset after upgrade #5246

Closed
bbondy opened this issue Oct 29, 2016 · 26 comments · Fixed by #8060
Closed

Fixed default browser setting reset after upgrade #5246

bbondy opened this issue Oct 29, 2016 · 26 comments · Fixed by #8060
Assignees
Labels
Milestone

Comments

@bbondy
Copy link
Member

bbondy commented Oct 29, 2016

Original title: Default browser setting gets reset after upgrade #5246 (comment)

Test plan

#8060 (comment)

Original issue description

https://twitter.com/konacommuter/status/792107397900673024

@jonathansampson can you audit our defaults registry code to see why Microsoft is resetting us sometimes? I think only on win10.

Related code:
https://github.com/brave/browser-laptop/blob/master/res/braveDefaults.nsi
brave/muon@7ab8325

But maybe inspecting using regedit is easier.

@bbondy bbondy added this to the 0.12.9dev milestone Oct 29, 2016
@srirambv
Copy link
Collaborator

Looks like a Windows issue after the recent update. I am not able to even set Edge as default browser.
defaultbrowser

The Only way to set is now by Control Panel>Programs>Default Programs>Set Default Programs and then Brave shows up in System settings. Setting Brave this way also sets it as default client for Email.
image

@bsclifton
Copy link
Member

I believe this has been an issue for as long as I've used Brave ☹️

Original issue here:
#2054

@lukemulks
Copy link
Collaborator

FWIW - after Windows 10 reset my default browser from Brave to Edge happened again today (for the ~6th time now), I decided to dig in a little more. Admittedly, I'm not as versed in how these updates are detected or configured within the OS to recommend a direct course of action to fix, but I'm going to add some additional info about the issue here in case it helps (as it's a pesky bugger or an annoyance).

I've done some digging around the Windows forums, and there appear to be other variations of the issue as well with Chrome, but I'm only going to include cases I've directly observed below for reference.

I've encountered three different variations of this issue over the past 4 months, one of which appears to be remedied.

Variations of Issue

  1. Windows resets default browser from Brave to Edge immediately following some Windows 10 updates. (still appears to be occurring, have experienced 2x)
  2. Windows resets default browser from Brave to Edge randomly. (occurred today, and in one other instance)
  3. Windows resets default browser from Brave to Edge, immediately after a Brave version update. (from what I can tell, this has been corrected - I observed this 2x). I have not experienced this variation of the issue for at least 3 Brave browser updates.

What may be potentially causing the issue
After resetting the default browser back to Brave within Windows 10 Settings > Default Apps, I went a step further into the system settings.

Steps on how to repro are going to be included below, but basically it appears that although the Default Browser is set to Brave, certain web extensions are not being associated to Brave, but instead are being associated with other browsers (IE and Chrome).

What I suspect is happening, is that Windows 10 has some security or update check that it runs using both xht | xhtml and http | https, but due to the "default browser" not associating all the extensions under the same browser, this mismatch might be flagged by Windows, resulting in the default browser being reset to Edge.

It might be an extension + protocol handling item, but am currently unsure.

I've updated (including in screencaps below) to assign those extensions to Brave, but have not assigned the protocol options as I expect they are probably unrelated (but am testing that out for the next windows update - will include protocols under Brave that aren't if I end up seeing Windows switch the default back to Edge again)

Steps to Reproduce

If Windows 10 resets the default browser from Brave to Edge:

From the Settings > Default Apps screen, click Set defaults by app at the bottom of the screen.

The Set defaults by app link opens:
Control Panel\Programs\Default Programs\Set Default Programs

Select Brave from the list of programs in the left column
windows10_browseralternatedefault_10302016

Select Choose Defaults for this Program

The Choose Defaults for this Program link opens:
Control Panel\Programs\Default Programs\Set Default Programs\Set Program Associations

With Brave set as the default browser in Windows 10, Brave only appears to be associated with 2/6 extension types, and 2/4 protocol types.
windows10_browseralternatedefault_associations_10302016

EXTENSIONS

Brave was set as associated to:
.htm
.html

Chrome was set as associated to:
.shtml
.webp

Microsoft IE was set as associated to:
.xht
.xhtml

I'm able to select the other extension types and associate them to Brave manually. I suspect this will likely prevent reoccurrences of the issue
windows10_browseralternatedefault_associations_update_10302016

I'm not sure if there is a way for Brave to include the extensions above when the user opts to use Brave as the default within the Brave app, but that might do the trick if possible.

I'll be sure to update here if I run into the issue again after making these manual adjustments. I hope the info helps with resolving (if it's possible to fix independent of MSFT).

@bbondy
Copy link
Member Author

bbondy commented Nov 4, 2016

Great info thanks, worth noting if the problem goes away after 0.1.28 since I fixed a crash with url handling for the default handler, maybe windows detected such a crash and reset it at that point.
c73844c

@lukemulks
Copy link
Collaborator

Confirming that I have just experienced the issue again (within ~60min of updating to 0.1.28).

What's strange about this particular instance is that I did not receive any notification from Windows that the default browser was reset from Brave to Edge.

No notification record displaying in the Win 10 Action Center notification history this time either.

Typically the notification would be visible, with the record temporarily saved in the Action Center history.

Within Brave (Gen Settings), Brave is still indicating that it is set as the default browser, despite Windows resetting the default to Edge.

This is the first instance I have experienced where this has taken place without any type of visible notification from Windows.

@lukemulks
Copy link
Collaborator

windows10_browser_update_issue_protocol_11072016

^^^ - it appears that after the update to v0.1.28, all of the default extension types that were associated by default to Brave remained that way, but the HTTP & HTTPS protocol associations were updated from Brave to Microsoft Edge.

I haven't updated any settings since this browser reset occurred today, so if there are any other areas you'd like me to check before updating the default back to Brave within the OS, let me know and I'll be happy to reference anything from this end.

@bbondy bbondy modified the milestones: 0.12.10 release , 0.12.9dev Nov 8, 2016
@bbondy bbondy modified the milestones: 1.0.0, 0.12.10 release Nov 15, 2016
@bsclifton bsclifton changed the title Default browser setting getting reset on Win10 Default browser setting gets reset after upgrade Dec 20, 2016
@srirambv
Copy link
Collaborator

+1 from support

@cndouglas
Copy link

cndouglas commented Feb 1, 2017

+1 from #6987 ("Default Browser" setting lost upon update). A user observed the problem when updating from version 0.13.0 to 0.13.1.

@lukemulks
Copy link
Collaborator

Confirming the default browser reset happened to me as well from 0.13.0->0.13.1.

Windows 10, 64bit OS.

Note that last week, the default browser was changed again, but it was changed by Windows, and didn't take place following a Brave update.

Vivaldi users have also been complaining about Windows 10 switching their default browser selection as of last week, so it appears that while the 0.13.0->0.13.1 update did cause a default browser change, that there are still enough instances of Windows 10 changing the default browser to warrant Vivaldi releasing articles about Windows being anti-competitive by changing the default browser (article was released last week about this).

One noticeable difference between when Windows 10 changes the browser setting, and when a Brave update causes the change (that I have directly observed):

When Windows 10 changes the default browser, the default browser goes from Brave to Edge.

When a Brave update changes the default browser, the default browser is a blank gray tile within the OS default browser settings.

@izzylaif
Copy link

izzylaif commented Feb 9, 2017

OK, I'm sick and tired of this. For over 10 years now, I've been using portable version of Mozilla Firefox as my main browser ever since Windows XP, for privacy concerns. I have both Firefox Portable and its TEMP folders on an encrypted container (TrueCrypt/VeraCrypt, BitLocker), which I mount manually as a K: drive after each Windows logon. The perks of this is no one can access your browser (where passwords, browsing history and lots of other sensible stuff is stored nowadays), even if they gain access to my desktop PC or laptop, because you need a password to decrypt the drive. Even if the laptop is stolen, the only thing I lose is a bit of money, and not my passwords and privacy. I also do not use non-portable software at all, which keeps my Windows uncluttered, and when I need to reinstall Windows, I just backup the folder where all portable software is and the cryptocontainer to an external drive, format local drive, do a fresh install, and copy back the folders to get all the apps with all the settings. The only thing left is to set up default programs and file associations to make the pc open files with correct portable apps. This also serves another purpose: I use 3 PCs daily, and to sync all programs and settings between them, I just copy over the said folder and crypted drive container, and I'm good.

This long preface is to avoid the stupid argument "lol your portable apps are not designed to be used as desktop apps, do a proper install of the programs". I have good reasons to do it the way I do it.

The issues started with Win8, which showed empty icons (a blank paper sheet), if you put the shortcut into start menu, taskbar or desktop. Probably because of the drive not being mounted at logon, when these icons are populated. This also rarely, but happened in Win7. To get the icons back, I had to clear and rebuild thumbnail cache and restart explorer.exe. I finally fixed it in idiotic way, by putting the icons on the C: drive and linking them to the desktop shortcuts. Not pretty, but it works.

But ever since updating to Windows 10, I'm having an issue with Default Programs which is driving me nuts.
image

For some reason, Firefox Portable is gone from metro Default programs interface. It is present in the old school Default programs, however the HTTP and HTTPs default actions are unchecked.
image

Because of this, every time I click a link in a program, like email client or just About section of any other program, an Open with menu appears to select the browser.
image

If I recheck those two settings after I boot and mount the crypto container where Firefox is, everything opens fine. Until next reboot. How can I fix it? I tried putting shortcuts on c: drive and pointing default programs there, also I tried symlinks and other stuff to no avail. I don't like the idea of having the set default program batch run every time I mount the crypto drive, even though it's possible. This behaviour was not present up until Win10. How to prevent windows from unchecking that? Can I change ownership of that registry tree? Which tree?

Any help much appreciated.

PS: These are clean installs of Windows 10 Home, PRO and LTSB with all updates upto Jan 2017.

@lukemulks
Copy link
Collaborator

lukemulks commented Feb 10, 2017 via email

@bsclifton
Copy link
Member

bsclifton commented Mar 28, 2017

I've been looking into this and it's definitely an interesting issue. I'd like to document one use-case completely (will revisit others later)

Brave is default and Auto upgrade happens

  1. Manually install an older version of Brave (0.13.4).
  2. Use the default programs UI to set everything to use Brave as the default program.
  • hit Windows key, type default programs, and push enter
  • click Set defaults by app
    screen shot 2017-03-27 at 5 24 09 pm
  • Click Brave on left and pick "Choose defaults for this program"
  • use the UI to pick all available options to Brave
  • click Save and then re-open the same dialog, to verify everything is set to Brave
  • Everything should look like this
    screen shot 2017-03-27 at 5 38 03 pm
  1. After setting the defaults, close the UI completely
  2. Launch Brave and use Help > Check for Updates
  3. An update will appear; accept it / install / relaunch
  4. Quit Brave

At this point, the default programs still seem to be set properly. This can be verified in regedit by checking the following keys:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice\Progid
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice\Progid
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice\Progid

In each of these cases, you'll see the value set to BraveHTML. However, if you open the default programs UI again, this will reset ONLY the HTTP and HTTPS protocol handlers, changing them to Microsoft Edge.
screen shot 2017-03-27 at 5 19 24 pm

@bsclifton
Copy link
Member

I've done registry dumps of the following registry branches BEFORE and AFTER upgrading:

  • HKEY_CURRENT_USER > Software > Clients > StartMenuInternet > Brave
  • HKEY_CURRENT_USER > Software > Microsoft > Windows > Shell > Associations > UrlAssociations

In both cases, the keys are identical before and after the upgrade. However, if I open the default programs UI (seen above) OR if I just wait long enough, the keys for ONLY HTTP and HTTPS get reset back to Microsoft Edge

There are three use-cases which can cause the default browser to be reset:

  • Brave is default and is Auto upgraded (captured in post directly above this)
  • Brave is default and Windows is updated (reported by @lukemulks in one of the posts above)
  • Brave is default and is re-installed

I'll continue digging in... it seems that something suspicious is going on here.

@bsclifton
Copy link
Member

Based on some posts I've read, I tried putting this registry hack in place:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Classes\AppXq0fevzme2pys62n3e0fbqa7peapykr8v]
"NoOpenWith"=""
"NoStaticDefaultVerb"=""

[HKEY_CURRENT_USER\SOFTWARE\Classes\AppX90nv6nhay5n6a98fnetv7tpk64pp35es]
"NoOpenWith"=""
"NoStaticDefaultVerb"=""

This does prevent Microsoft Edge from being assigned as the default program for HTTP and HTTPS. However, it wipes that entry completely... leaving HTTP and HTTPS unhandled.
screen shot 2017-03-27 at 11 18 20 pm

Link to posts I used as reference when creating the above:

@bsclifton
Copy link
Member

After the upgrade is complete, RuntimeBroker.exe will come around and wipe out BraveHTML values for HTTP / HTTPS and replace with the default (Microsoft Edge). Here's a screen cap of it happening using ProcessMonitor.exe
screen shot 2017-03-27 at 11 43 32 pm

During the upgrade itself, there are some registry operations happening (which may be triggering RuntimeBroker.exe to run- it seems this is a delicate process).
screen shot 2017-03-27 at 11 47 42 pm

@lukemulks
Copy link
Collaborator

lukemulks commented Apr 4, 2017

@bsclifton = hero. ❤️

@luixxiul
Copy link
Contributor

luixxiul commented Apr 9, 2017

Comment left: #8060 (comment)

@alexwykoff alexwykoff changed the title Default browser setting gets reset after upgrade Fixed default browser setting gets reset after upgrade. Apr 25, 2017
@alexwykoff alexwykoff changed the title Fixed default browser setting gets reset after upgrade. Fixed default browser setting reset after upgrade. Apr 25, 2017
@alexwykoff alexwykoff changed the title Fixed default browser setting reset after upgrade. Fixed default browser setting reset after upgrade Apr 25, 2017
@izzylaif
Copy link

izzylaif commented May 9, 2017

Windows 10 build 1703 (creator's) doesn't have this issue anymore. I've been using 1703 build for over a week, and the HTTP/HTTPS strings do not get reset. 1703 fixed this for me.

@Jacalz
Copy link
Contributor

Jacalz commented May 9, 2017

But it was fixed in 0.15.0

@izzylaif
Copy link

izzylaif commented May 9, 2017

I don't give a 💩 about brave browser, sorry. my problem was with firefox portable, see my post above.

@bsclifton
Copy link
Member

bsclifton commented May 9, 2017

@izzylaif are you saying the Creators update doesn't reset default http/https for browsers? (for any app, like for example, Firefox portable?)

This is great news actually- we would like to have a portable version too 😄

Sorry to hear that you don't enjoy the Brave browser ☹️

@izzylaif
Copy link

izzylaif commented May 9, 2017

I don't see the need for any other browser, since we have firefox for like 15 years already
Yes, seems that Creator's update 1703 changed the behavior of RuntimeBroker and it doesn't wipe out/default to Edge the HTTP and HTTPS default program line anymore.

Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\URLAssociations" /v "http" /t REG_SZ /d "FirefoxPortableURL" /f

Reg.exe add "HKLM\SOFTWARE\Clients\StartMenuInternet\FirefoxPortable\Capabilities\URLAssociations" /v "https" /t REG_SZ /d "FirefoxPortableURL" /f

At least not within the first 5 minutes after boot, while I mount the container as a drive with Firefox anyway.

@bsclifton
Copy link
Member

@izzylaif great- thanks for the update 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants