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

Cannot set Brave as default browser Arch Linux #2377

Closed
cndouglas opened this issue Dec 5, 2018 · 28 comments
Closed

Cannot set Brave as default browser Arch Linux #2377

cndouglas opened this issue Dec 5, 2018 · 28 comments
Assignees
Labels
closed/no-milestone OS/Linux/arch packaging Making Brave natively available to install on a variety of platforms, app stores, and repositories. priority/P5 Not scheduled. Don't anticipate work on this any time soon.

Comments

@cndouglas
Copy link
Contributor

Copied from brave/browser-laptop#15323 by @Kallestofeles

Description

Cannot set Brave as the default browser in Arch linux. Set as default option does nothing.
System:
Kernel: 4.19.4-zen1-1-zen x86_64 bits: 64
Desktop: Gnome 3.30.2
Distro: Arch Linux

Steps to Reproduce

  1. Install brave-bin or brave-dev-bin from the AUR
  2. Run the Brave browser
  3. Click on "Set as default" browser button
    Rinse and repeat...

Actual result:

Expected result:

Reproduces how often:

Brave version (brave://version info)

Brave Version 0.56.15 Chromium: 70.0.3538.110 (Official Build) unknown (64-bit)

Reproducible on current release:

  • Does it reproduce on brave-browser dev/beta builds?

Website problems only:

  • Does the issue resolve itself when disabling Brave Shields?
  • Is the issue reproducible on the latest version of Chrome?

Additional Information

@Brave-Matt
Copy link

@helionmelion
Copy link

helionmelion commented Dec 8, 2018

I solved this problem manually setting xdg configs:

xdg-mime default brave.desktop x-scheme-handler/http
xdg-mime default brave.desktop x-scheme-handler/https

@Kallestofeles
Copy link

Thanks but does not work.
image
The issue is not that Brave was not the default browser - it is! It handles all the requests as it should, however every time the browser gets opened, it shows this set as default message + set as default from the settings does not work. The issue essentially is only cosmetic but annoying as hell as it pops up every time the browser is opened.

@helionmelion
Copy link

could you try this:
xdg-settings set default-web-browser brave-bin.desktop
next query if the operation was successfull:
xdg-settings check default-web-browser brave-bin.desktop

@cinderisles
Copy link

xdg-settings check default-web-browser brave.desktop returns yes but Brave still shows it's not the default browser. xdg-open opens Brave as it should.

@helionmelion
Copy link

tested here,
-setting other browser (for instance, opera) as default: xdg-settings set default-web-browser opera.desktop
-going back to brave: after setting brave as default browser by xdg-settings, the message appears, but closing it (x) does the trick, it does not pop up again.
But if I click "make default" in brave settings, the pop up is called again.
so, close the pop up by (x) and not clicking "set as default"

@tildelowengrimm tildelowengrimm added OS/Linux priority/P4 Planned work. We expect to get to it "soon". labels Dec 12, 2018
@tildelowengrimm
Copy link
Contributor

I think that the next step in debugging this is working out how Arch is doing defaults/handlers differently from other distros so that we can detect and support that.

@rebron rebron added the needs-more-info The report requires more detail before we can decide what to do with this issue. label Dec 18, 2018
@rebron rebron added this to the 1.x Backlog milestone Dec 18, 2018
@aphelionz
Copy link

aphelionz commented Dec 21, 2018

Confirmed this is happening on KDE Neon as well. I don't think this is an OS problem, rather a problem with how Brave is self-detecting if it's the default or not.

@rebron rebron modified the milestone: 1.x Backlog Feb 7, 2019
@ryanerwin
Copy link

The erroneous "Set as Default" dialog is still happening on Arch.

Brave: Version 0.61.51 Chromium: 73.0.3683.75 (Official Build) unknown (64-bit)
Linux 5.0.4-arch1-1-ARCH #1 SMP PREEMPT Sat Mar 23 21:00:33 UTC 2019 x86_64 GNU/Linux

Brave is set as the default for .html, http and https, but the dialog still pops up...

@fmarier
Copy link
Member

fmarier commented Apr 24, 2019

What is the output of ls -l /etc/alternatives/x-www-browser?

Does making Brave the default using update-alternatives --config x-www-browser make the message go away?

@cinderisles
Copy link

@fmarier not sure Arch has update-alternatives. I believe that is a Debian-based thing

@fmarier
Copy link
Member

fmarier commented Apr 24, 2019

I also saw update-alternatives on Fedora and so I assumed it was a standard Linux thing. Though looking at it closer, while it exists on Fedora, there is no /etc/alternatives/x-www-browser.

So I think you're right, that last part looks like a Debian-specific thing.

@Pitasi
Copy link

Pitasi commented Jul 2, 2019

For the ones like me who manually set Brave as default but were tired of the popup at every startup: just click the X instead of "Set as default".

Took me almost a week to realize this :)

EDIT. I also realized it was already been said some comments up here: #2377 (comment)

@tildelowengrimm tildelowengrimm added the packaging Making Brave natively available to install on a variety of platforms, app stores, and repositories. label Jul 2, 2019
@kirk-baird
Copy link

Similar to @helionmelion
I had to set it manually using xdg
xdg-settings set default-web-browser brave-bin.desktop
Note brave.desktop did not work as I installed brave-bin from AUR.

If you want to see what is current the default browser in xdg use xdg-settings get default-web-browser

@helionmelion
Copy link

Similar to @helionmelion
I had to set it manually using xdg
xdg-settings set default-web-browser brave-bin.desktop
Note brave.desktop did not work as I installed brave-bin from AUR.

If you want to see what is current the default browser in xdg use xdg-settings get default-web-browser

Yes I'm using the aur version now.
xdg-settings get default-web-browser
brave-beta-bin.desktop

@Valinwolf
Copy link

I can confirm that this is still a problem in Arch with Gnome 3.32.2 and kernel 5.2.2-arch1-1-ARCH. I have set Brave as the default browser in the Gnome Control Center as well as run the following commands, without luck:

xdg-mime default brave-bin.desktop x-scheme-handler/http
xdg-mime default brave-bin.desktop x-scheme-handler/https
xdg-settings set default-web-browser brave-bin.desktop

Running xdg-settings check default-web-browser brave-bin.desktop returns yes
Running xdg-settings get default-web-browser returns brave-bin.desktop
Running xdg-open "https://duckduckgo.com" opens https://duckduckgo.com in Brave

Clicking Make Default in the settings or on the popup does not help.
Clicking the X on the popup does not disable the popup.

@Gilgames000
Copy link

Gilgames000 commented Nov 1, 2019

I tried to set brave as my default browser using xdg-settings

$ xdg-settings set default-web-browser brave.desktop

but Brave was still showing the pop-up, so after clicking on "Set as default" I checked:

$ xdg-settings get default-web-browser
brave-browser.desktop
$ xdg-settings check default-web-browser brave-browser.desktop
no

So I thought, well maybe Brave is expecting the executable to be called brave-browser and not brave hence when I click on "Set as default" it's setting the wrong entry? So I aliased brave-browser to brave in my .bashrc:

alias brave-browser=brave

opened Brave, clicked on "Set as default". Logged out of my user and back in to check if it worked and the pop-up was gone!
Also now xdg-settings is showing

$ xdg-settings check default-web-browser brave-browser.desktop
yes

Hope this helps.

@fmarier fmarier added priority/P5 Not scheduled. Don't anticipate work on this any time soon. and removed priority/P4 Planned work. We expect to get to it "soon". labels Nov 1, 2019
@fmarier
Copy link
Member

fmarier commented Nov 1, 2019

alias brave-browser=brave

Interesting. I wonder whether that's something that the Brave maintainer in Arch could add to the package.

@badlydrawnface
Copy link

I figured it out,

You need to set the HTML default application to Brave for the popup to stop appearing

(Tested with KDE only, on Arch Linux)

  1. Create a blank HTML file
  2. Go to Open With, then Other Application
  3. Choose Brave, and click the "Remember Application" tick.
  4. Open the file in Brave, there, the "Brave is not your Default Browser" bar stops showing.

@whezzel
Copy link

whezzel commented Nov 14, 2019

You can also just click the 'x' instead of 'Set as Default' and the popup will stop appearing

@martin-varbanov96
Copy link

Using sudo was the way I fixed it:


517 sudo xdg-settings set default-web-browser brave.desktop
518 brave http://archlinux.org/


Randomly tried all these, all of them failed:


502 xdg-settings set default-web-browser brave.desktop
503 xdg-open http://archlinux.org/
504 xdg-settings set default-web-browser brave.desktop
505 xdg-open http://archlinux.org/
507 xdg-settings set default-web-browser firefox.desktop
508 xdg-open http://archlinux.org/
509 xdg-open http://archlinux.org/
510 xdg-mime default brave.desktop x-scheme-handler/http
511 xdg-mime default brave.desktop x-scheme-handler/https
512 xdg-open http://archlinux.org/
513 xdg-settings set default-web-browser brave-bin.desktop
514 xdg-open http://archlinux.org/
515 brave http://archlinux.org/
516 brave-bin http://archlinux.org/

@baptiste-dauphin
Copy link

baptiste-dauphin commented May 27, 2020

On Debian 9 x64 (using i3wm) nor xdg-settings neither xdg-mime don't even worked (even when outputing 0).

To solve the problem I had to manually edit ~/.config/mimeapps.list
It's dirty but it works !

[Default Applications]
x-scheme-handler/http=brave.desktop
x-scheme-handler/https=brave.desktop
x-scheme-handler/ftp=brave.desktop
x-scheme-handler/chrome=brave.desktop
text/html=brave.desktop
application/x-extension-htm=brave.desktop
application/x-extension-html=brave.desktop
application/x-extension-shtml=brave.desktop
application/xhtml+xml=brave.desktop
application/x-extension-xhtml=brave.desktop
application/x-extension-xht=brave.desktop

@fmarier
Copy link
Member

fmarier commented Sep 11, 2020

Possible work-around for Arch Linux, courtesy of #11032 (comment):

ln -s ~/.config/mimeapps.list ~/.local/share/applications/mimeapps.list

@oviniciusfeitosa
Copy link

oviniciusfeitosa commented Dec 8, 2020

If are you using Brave Nightly follow these steps:

xdg-mime default brave-browser-nightly.desktop x-scheme-handler/https
xdg-mime default brave-browser-nightly.desktop x-scheme-handler/http
xdg-settings set default-web-browser brave-browser-nightly.desktop

Hope it helps 👍

https://vinnyfs89.gitbook.io/knowledge/technology/browser/chrome-or-brave/known-issues#set-brave-nightly-as-default-browser-using-linux

@adriano-pinaffo
Copy link

I figured it out,

You need to set the HTML default application to Brave for the popup to stop appearing

(Tested with KDE only, on Arch Linux)

  1. Create a blank HTML file
  2. Go to Open With, then Other Application
  3. Choose Brave, and click the "Remember Application" tick.
  4. Open the file in Brave, there, the "Brave is not your Default Browser" bar stops showing.

This worked for me on Arch with KDE, but instead I went to KDE system settings and set the html file association to brave there (it was Firefox).
PS.: I had tried all other possible combinations.
Screenshot_20201212_105318

@FahriDevZ
Copy link

I am using archlinux with xmonad, I install brave-bin.
I tried set default browser does not work because result xdg-settings check default-web-browser <name>.desktop is no.

My solution, check the desktop entity name.

ls /usr/share/applications | grep brave
# my result is: brave-browser.desktop

if doest not exits, you can check in different location, see here.

After you know what desktop name, you can try set

xdg-settings set default-web-browser brave-browser.desktop

Check

xdg-settings check default-web-browser brave-browser.desktop
# this result must be a yes

@wknapik
Copy link
Contributor

wknapik commented Mar 23, 2021

Arch documentation on default applications

https://wiki.archlinux.org/index.php/default_applications

Brave .desktop filenames on Arch Linux

Choose a .desktop file corresponding to your chosen package:

  • brave-browser.desktop (brave, brave-bin)
  • brave-browser-beta.desktop (brave-beta-bin)
  • brave-browser-nightly.desktop (brave-nightly-bin)
  • brave-browser-dev.desktop (brave-dev-bin)
  • brave.desktop (brave-git)

Out of these, the brave-bin package is recommended. It's the most popular, is actively maintained, packages pre-built binaries and is kept up to date with upstream releases.

Set Brave as default browser

It should be noted that setting default applications on Linux is not as straightforward, as on other systems. This is the flip side of the variety of possible setups across Linux distributions and within each one.

Different software respects different ways of setting defaults, so YMMV, but xdg-utils should be the go-to package for the purpose and should cover most cases. Users of desktop environments, which may use their own mechanisms to set defaults, should consult the documentation for their specific DE.

To use the stable release of Brave as default (brave and brave-bin packages), execute the following:

xdg-settings set default-web-browser brave-browser.desktop
xdg-mime default brave-browser.desktop x-scheme-handler/http
xdg-mime default brave-browser.desktop x-scheme-handler/https

This should be enough. If not, setting the BROWSER variable to brave may help in some cases.

Relying on xdg-utils appears to also be the approach in Chromium-based browsers (including Brave).

Debugging

% xdg-settings get default-web-browser  
brave-browser.desktop
% xdg-settings check default-web-browser brave-browser.desktop
yes
% xdg-mime query default x-scheme-handler/http
brave-browser.desktop
% xdg-mime query default x-scheme-handler/https
brave-browser.desktop
% echo "$BROWSER"
brave
% grep brave ~/.config/mimeapps.list                   
text/html=brave-browser.desktop
x-scheme-handler/http=brave-browser.desktop
x-scheme-handler/https=brave-browser.desktop
x-scheme-handler/about=brave-browser.desktop
x-scheme-handler/unknown=brave-browser.desktop
%

Final notes

If the above doesn't work for you, please include any relevant information about your setup - most notably the desktop environment/window manager and the Brave package.

@rebron
Copy link
Collaborator

rebron commented Sep 16, 2021

Closing due to the instructions provided in the last comment.

@rebron rebron closed this as completed Sep 16, 2021
@rebron rebron added closed/no-milestone and removed needs-more-info The report requires more detail before we can decide what to do with this issue. labels Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed/no-milestone OS/Linux/arch packaging Making Brave natively available to install on a variety of platforms, app stores, and repositories. priority/P5 Not scheduled. Don't anticipate work on this any time soon.
Projects
None yet
Development

No branches or pull requests