How do i make any *.url file open in Firefox?

Hello. I want to be able to just double-click any *.url file created on linux or windows to open the link in Firefox on Manjaro.

Just setting the association from Thunar’s “Open With” menu does not work.

I also have tested the bash command i found in an article elsewhere without any luck.

bash -c “cat %f | grep URL | cut -d’=’ -f2 | xargs firefox &”
Source: https : / / saidulhassan . com / open-url-files-in-linux-mint-ubuntu-1029

So. How do i get this to work? :confused:

You need to understand the diff between a Windows shortcut file and a Linux desktop file.

You cannot make the compatible - working the same way.

but you can create custom action with thunar - right click “open window url”

See the link i put.

Like i said. “Open With” does not work. All I’m getting from that is a question from firefox to “download” the file.

so it’s a different question… (no double-click)
Firefox does not see the link as an html page

Without .url source, without test/returns in a terminal we cannot help you

i have same action with dolphin without problem Exec=xdg-open "$(awk -F'=' '/^URL/{print $2}' %F)"

terminal:

firefox file.url
Will do exactly the same as right clicking and picking “Open With”

sample.url contents

[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
IDList=
URL=https://devfme.abley.com/fmeserver/apps/DWGtoFBX/

no is not a default action (as write by linux-aarhus), not possible to open with firefox

in thunar:
create action “open url file”
in command enter:

firefox "$(awk -F'=' '/^URL/{print $2}' %f)"

right click on thunar, BUT not in “open with” , select new item menu (“open url file”) at bottom after “rename”

Yeah. that does work. But it’s not really what i’m looking for. Is there any way to create a redirect entry in “Open With” ?

something like “Open With” > URLforward.sh > execute custom action

TLDR: why this issue even exists is beyond me.

Because .url files are a Windows thing.

This might help: How to Open .URL files in Ubuntu Linux – patrickgawron.com

Had this been on say ubuntu 10, sure…

also the link isn’t that helpful because in the original post i already have the same thing tested. It doesn’t work.

Doesn’t matter which distro it is. The instructions are for Thunar specifically.

Woops. Sorry, I missed that.

Works fine for me. Note the difference between the statements in the two articles:

bash -c “cat %f | grep URL | cut -d’=’ -f2 | xargs firefox &”
bash -c "cat %f | grep URL | cut -d'=' -f2 | xargs chrome &"

And I don’t mean “firefox” vs. “chrome”. Works with either one.
(hint: backticks vs. single-quotes and those italic double-quotes (sorry, don’t know the name) vs. normal double-quotes)

Use the latter example and it should work.

1 Like

I copy/pasted sample.url to home folder and mimetype recognised the file type
sample.url: application/x-mswinurl

Right-click menu for the file in Thunar showed option - Open with "rundll32"

Double-click on the file launched it in Firefox no problem

Pamac confirms /usr/lib32/wine/rundll32.exe is owned by wine 6.7-1

So I suggest you install wine

1 Like

Using wine for opening a url in the browser is a bit of an overkill though :slight_smile:

Again the (correct) one-liner above should work fine. :man_shrugging: