I have a huge number of .URL files on my drive since I have never used bookmarking... its so much more efficient to drop links into folders, and far more flexible.
Unfortunately, GNOME uses a different format and won't accept the windoze URL file under any circumstances. The only option is to open the URL file in a text editor and grab the url with copy --> paste.
So here's how to open that URL file automatically:
First create this script and name it url.sh:
That will find the URL in the .URL file, and open firefox with it. To test it, try this in a terminal:
FFOPENURL=$(grep -a -G URL=* $1)
Now enter these commands:
bash <dir>/url.sh <path to URL file>
Or anywhere else you want it to go. I prefer /usr/bin because its easy to remember. (PATH won't help us here however since this isn't exactly a command)
sudo cp <path to url.sh> /usr/bin
sudo sudo chmod ugoa+x /usr/bin/url.sh
Finally its time to associate the [Internet Shortcut] or .URL file format in GNOME/Nautilus.
Right click on a .URL file and go to the "open with" tab. Associate it with this command:
If all goes well, you can now open the url file in FireFox.
If all doesn't go well (it didn't for me) you will get an error about insecure filetype... bla bla bla. If that happens, associate the file with a text editor and right click the file to get "open with bash".
Note: this quirk is not present in KDE!
Edit: Here are some keywords that might make this tutorial more searchable.
Microsoft Windows url file .url shell script interoperability internet shortcut how to plain text mswinurl bookmark microsoft windows