When I am using xdg-open
to open a link in Chromium, it just results in a new Chromium window with only the new tab page, with nothing else.
For example, xdg-open 'https://askubuntu.com'
will just open a new Chromium window and won't open up AskUbuntu.
It just seems that the URL isn't being passed to Chromium, as invoking Chromium directly does work and opens the desired page: chromium-browser 'https://askubuntu.com'
works.
Obviously, Chromium is the default browser.
Where could the problem be, and how can I fix that? It is especially annoying when some programs use xdg-open
to open a link and you can't go to the page you want, or even see what was opened.
Best Answer
The issue is indeed that
xdg-open
does not pass the requested URL to Chromium, so instead of runningchromium-browser url-here
, it is executingchromium-browser
which just opens a new window.After searching on the Internet, I found out that
xdg-open
uses some "config" files located in/usr/share/applications
./usr/share/applications/chromium-browser.desktop
seemed to be correct, as it is configured to pass the URL to Chromium correctly:So what was wrong? It turns out that there's another location which
xdg-open
uses and that has priority over/usr/share/applications
.I have no idea as to why there's another chromium-browser.desktop, but note that this Exec line does not pass the URL; it is missing the
%U
. So I simply appended%U
to this line. This instantly fixed all issues withxdg-open
and Chromium.