Open Windows Favorites Files in Firefox

Today, it dawned upon me that I really haven’t used wine to run anything under FreeBSD in I don’t know how long. I figured that’s a good reason to uninstall it. I can always reinstall it if I need it, but for the few things I need windows for, I just boot into windows itself.

I also have all of my old stuff from windows backed up onto FreeBSD and sync it with the NAS. Over time, I’ve been slowly cleaning it up and deleting old stuff that’s no longer needed.

One of the more interesting things for me were my old favorites from Internet Explorer. These are mostly when Firefox was in beta, so that should give an idea of how old they were. There are tons of them, and I want to see if there’s anything interesting and worth keeping.

The files are just simple text files with a few fields, so I figured it should be simple enough to just open it in Firefox with a script. I’m surprised that Firefox doesn’t have this built in.

How I got it working was I created a .Desktop file and the associated it with the .URL files. It worked like a charm.

The relevant part of that file is the line below:

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

It uses AWK to find the line beginning with, URL then takes the next field and uses that as an argument to run Firefox. That opens the URL up in a new tab for me.

Why not use the power of the computer to do repetitive things for me? Maybe this will help someone else out.