3

Is it possible to open a file browser via xdg/xdg-open by clicking on a HTML link?

E.g.:

I'd like to open my file browser (Thunar / XFCE / Xubuntu 18.04) by clicking on a link like: xdg:///media/Data/. If I enter the URL manually a xdg dialog which asks whether I want to open xdg-open shows. But if I click Ok then an error shows that the address could not be found/opened. The path to the directory, however, is correct and exists.

Kurztipp
  • 391
  • 2
  • 18

1 Answers1

0

Not sure if this answers your question...

I can open the file manager with xdg-open from the terminal by running:

xdg-open file:///home

or

xdg-open /home

In my case nautilus opens up and shows me that path.

With a web-browser it is possible to do the same by browsing an html file containing this lines:

<a href="file:///home">file:///home</a>

<br>

<a href="/home">/home</a>

Both links are managed by the browser, in my case (using Brave browser) I end up browsing those paths though my browser.

I think that what you need is opening those links directly with the file-explorer (Thunar in your case), and not with the web-browser built-in file browser.

I guess this is possible by using more complex html (or js or php) code. Or even by setting up the browser so that it always opens file:// paths using the OS file manager (maybe there are already extensions to achieve that).

I would be cool to have something like xdg-open filebrowser:///home, but I am not sure that something like this exists...

manero
  • 1