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
Firefox and Chromium "set as default" not including wrapper #4370
Comments
This is a great example why wrappers are error prone. |
Is there a easy way to fix this? I don't see one |
The easy way is to use a non-absolute path in the .desktop file, i.e. |
@edolstra This .desktop file is generated by Firefox when "set as default browser" is clicked - it's not one of nixpkgs's .desktop files. That'd involve a patch (which would have to be kept up to date with each Firefox release). |
Right, shouldn't be hard to do. |
Testing a patch now... |
@edolstra: I can't see the patch anywhere -- did it work? |
Chromium .desktop file includes |
This is handled and detected with mimetypes.
|
Would be really nice to fix this one, any takers? |
I think I have solved it for Firefox; as for Chromium — apparently it is non-trivial to test for me (StumpWM, not a DE) |
It helps to actually pass the URL to chromium :) Related to NixOS#4370
There's still no obvious way to set the default browser that I can find - anyone know what the status is here? |
A possibly reasonable option in the case of Firefox would be to disable the default browser check using the if check_is_not_default_browser && [ ! -e ~/.config/nix-wrappers/firefox/never-ask ]; then
yad --title="Default browser" --text="Would you like to set Firefox as your default browser?" --button="gtk-ok:0" --button="gtk-cancel:1" --button="Never:2" --center
if [ $? -eq 0 ]; then
xdg-mime default firefox.desktop text/html
xdg-mime default firefox.desktop x-scheme-handler/http
xdg-mime default firefox.desktop x-scheme-handler/https
xdg-mime default firefox.desktop x-scheme-handler/about
elif [ $? -eq 2 ]; then
echo 1 > ~/.config/nix-wrappers/firefox/never-ask
fi
fi According to a google, similar should work for Chrome/Chromium, except passing Opinions? |
Is there no way to trick firefox into thinking its executable name is the wrapper ? |
Fixes NixOS#4370, hopefully. It's not clear if it can break anything.
Yes: 0834dbc but this needs some testing, and it affects many browsers. |
@vcunat I fixed the wrapper to work with 0834dbc (vcunat#2), but we get another issue. When we update firefox, we end up with a different /nix path, which firefox considers as a different browser. If you restart firefox (for example when installing addons) then you get the not-your-default-browser" warning. Investaigating MOZ_APP_LAUNCHER as solution, but I start to think that #4370 (comment) may be the most general solution. |
When "set as default browser" is clicked from within Firefox, it places a custom .desktop file in ~/.local/share/applications, and points to this from mimeapps.list in the same directory. This file launches Firefox without the wrapper when it's opened using xdg-open. The result is that if xdg-open is used when no Firefox window exists, it will be opened without environment variables set correctly, and without plugins.
The text was updated successfully, but these errors were encountered: