Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set as default seems to have no effect on Ubuntu 22.04 LTS (using Snap) #34053

Closed
hamirmahal opened this issue Nov 1, 2023 · 16 comments
Closed

Comments

@hamirmahal
Copy link

hamirmahal commented Nov 1, 2023

Description

Setting Brave as the default browser seems to have no effect on Ubuntu 22.04 LTS. I make it the default via settings, but I still receive the prompt to set Brave as my default browser after doing so.

Screencast.from.11-01-2023.04.56.08.PM.webm

Actual result:

Brave asks me to set it as my default browser, even after I have already done so, on Ubuntu 22.04 LTS.

Expected result:

Brave does not prompt me to set it as my default browser after I have already done so.

Reproduces how often:

Regularly

Brave version (brave://version info)

Brave | 1.59.124 Chromium: 118.0.5993.117 (Official Build) (64-bit)
Revision | 63d57e32ce0ff0a1e380461bc394351e97d1416a
OS | Linux

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards? No
  • Is the issue reproducible on the latest version of Chrome?
@brave brave deleted a comment from hamirmahal Nov 2, 2023
@brave brave deleted a comment from hamirmahal Nov 2, 2023
@brave brave deleted a comment from hamirmahal Nov 2, 2023
@brave brave deleted a comment from hamirmahal Nov 2, 2023
@brave brave deleted a comment from hamirmahal Nov 2, 2023
@brave brave deleted a comment from hamirmahal Nov 2, 2023
@brave brave deleted a comment from hamirmahal Nov 2, 2023
@bsclifton
Copy link
Member

@hamirmahal thanks for the report - I cleaned up the formatting, I hope you don't mind

Are you using Brave as a Snap? I know there can be problems with a few things when it's installed as a Snap. Set as default can not work, trying to create PWAs doesn't work properly too. Please let us know

The alternative would be to uninstall and use the install instructions at https://brave.com/linux/

@bsclifton
Copy link
Member

cc: @wknapik - not sure if there is a permission we're missing (ex: brave/brave-browser-snap#25)

@hamirmahal
Copy link
Author

@bsclifton you're welcome!

@hamirmahal
Copy link
Author

I installed Brave via Snap on Ubuntu 22.04 LTS. I assumed that was the "standard" way to do it because Brave via Snap was one of the first things I saw on a fresh install of Ubuntu.

@hamirmahal
Copy link
Author

The alternative would be to uninstall and use the install instructions at https://brave.com/linux/

I think I'll give this a look.

@wknapik
Copy link
Contributor

wknapik commented Nov 2, 2023

I wrote this about setting the default browser on Arch Linux, but it applies to any distro/browser.

I just ran the following test in a fresh Ubuntu 22.04 VM:

  • Booted up, printed a url in a terminal, clicked to open, Firefox was opened
  • Installed the Brave snap via the Ubuntu Software app and started Brave, clicked to open the url from the terminal and Brave was opened (with the bar at the top asking whether to make it the default browser)
  • Installed the Chromium snap via the Ubuntu Software app and started Chromium (it had the bar at the top asking to make it the default browser), clicked to open the url from the terminal and again Brave was opened
  • Clicked in Chromium to set it as the default browser and got a popup to confirm (Allow snap chromium to change "default-web-browser" to "chromium_chromium.desktop"?) and chose "Yes"
  • Clicked to open the url from the terminal and it opened in Chromium
  • Clicked in Brave to set it as the default browser, but got no popup to confirm the change
  • Clicked to open the url from the terminal and it opened in Chromium
  • Closed all windows, opened a terminal, printed a url, clicked to open it in a browser and it opened in Brave

Then ran a similar test again, but started with Chromium installation, followed by Brave installation. Chrome was set as default when installed. Then Brave was set as default when installed. Setting as default from withing Chromium didn't seem to work, but it did work from Brave. Both browsers didn't always display the prompt to set as default when not default.

Either I'm doing something weird, or this is a mess.

Most threads/issues I can find about this online, for Firefox, Chromium and Brave end with the advice to uninstall the snap and use the native app. While that's not a fix for the snap, it's a fix for the user.

We can dig deeper.

@wknapik
Copy link
Contributor

wknapik commented Nov 2, 2023

Repeated tests do seem to indicate that both the Firefox and Chromium snaps are able to set themselves as default, while the Brave snap can not.

@hamirmahal
Copy link
Author

Most threads/issues I can find about this online, for Firefox, Chromium and Brave end with the advice to uninstall the snap and use the native app. While that's not a fix for the snap, it's a fix for the user.

I did exactly this and the Set as default problem seems to have gone away. Thanks for the quick response here.

@hamirmahal
Copy link
Author

I was hoping the 'use system default' setting for Brave's theme would fix itself when I got off the snap version, but it's still an issue. I have that tracked separately with #33989.

@wknapik
Copy link
Contributor

wknapik commented Nov 3, 2023

I might have a lead on a fix, need to consult the snapcraft forum.

@rebron rebron added retention priority/P4 Planned work. We expect to get to it "soon". QA/Yes release-notes/include labels Nov 3, 2023
@wknapik
Copy link
Contributor

wknapik commented Nov 7, 2023

The root cause here is that the snap app is called "brave", so the browser needs to refer to brave.desktop, but refers to brave-browser.desktop.

The solution is to either rename the snap app to "brave-browser" (each snap can have multiple apps defined), which has the downside of changing what users need to execute to launch the browser (snap run brave vs snap run brave.brave-browser), or to change what .desktop file the browser refers to to set itself as default.

The browser change looks like the better option at this point, since we apparently can't set an alias from the old snap app to the new one.

I think just allowing the variable-based override in official builds would be enough (https://github.com/brave/brave-core/blob/master/chromium_src/chrome/common/channel_info_posix.cc#L74), or we could detect that the app is running as a snap at runtime and alter the name to a static "brave.desktop".

@wknapik
Copy link
Contributor

wknapik commented Nov 7, 2023

I'm still waiting for replies on the snapcraft forum, but in the meantime I'll test the browser change and if it works, will open a PR.

@wknapik
Copy link
Contributor

wknapik commented Nov 8, 2023

Confirmed that brave/brave-core#20892 + brave/brave-browser-snap#30 resolve this issue

@wknapik
Copy link
Contributor

wknapik commented Nov 20, 2023

This should be fixed in the next snap package release

@wknapik wknapik closed this as completed Nov 20, 2023
@kjozwiak kjozwiak added this to the 1.62.x - Nightly milestone Nov 20, 2023
@kjozwiak kjozwiak added QA/No and removed QA/Yes labels Nov 21, 2023
@kjozwiak kjozwiak changed the title Set as default seems to have no effect on Ubuntu 22.04 LTS Set as default seems to have no effect on Ubuntu 22.04 LTS (using Snap) Nov 21, 2023
@kjozwiak
Copy link
Member

Labelling the above as QA/No as we don't have a Nightly version available via Snap. So it will be difficult to verify the above before uplifting. However, @wknapik mention that he verified the above locally on his Linux VM as per #34053 (comment).

@wknapik
Copy link
Contributor

wknapik commented Dec 1, 2023

Confirmed fixed via a test on Ubuntu 22.04

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

No branches or pull requests

6 participants