1

Getting this error as regular user:

~$ xdg-open http://www.google.com/
xdg-open: no method available for opening 'http://www.google.com/'
~$
~$ xdg-mime query default text/html
~$

Code from /usr/bin/xdg-open

  # if BROWSER variable is not set, check some well known browsers instead
    if [ x"$BROWSER" = x"chromium" ]; then
        BROWSER=links2:elinks:links:lynx:w3m
        if [ -n "$DISPLAY" ]; then
            BROWSER=firefox:mozilla:epiphany:konqueror:chromium:google-chrome:$BROW$
        fi
    fi

    open_envvar "$1"

    exit_failure_operation_impossible "no method available for opening '$1'"
}

Operating system: Ubuntu 16.04 Gnu/Linux

4
  • 2
    Why are you doing this as root? Does it work as expected if you do it as a regular user? You say "code modified", what code? Where? How did you modify it? – terdon Apr 11 '20 at 13:43
  • It didnt work as a regular user – xavier96 Apr 11 '20 at 13:48
  • 1
    OK, then please edit your question and show what happens when you do it as a regular user instead of root since root is a very special case. And please also explain what the code you are showing is, where it is from, why it is relevant and how you changed it. – terdon Apr 11 '20 at 13:52
  • 1
    Also, what is the output of xdg-mime query default text/html and what browsers do you have installed? Is this Ubuntu server? Do you have a working graphical environment? – terdon Apr 11 '20 at 13:58
0

The MIME type xdg-open uses for URIs is x-scheme-handler/<scheme>, in your case x-scheme-handler/http and x-scheme-handler/https. You can put an entry for those using your desired .desktop file in your

${XDG_CONFIG_HOME:-$HOME/.config}/mimeapps.list

file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.