Hi,
I found a script at this link but it was not working properly;
https://ubuntugenius.wordpress.com/...t-explorer-shortcuts-in-ubuntu-using-firefox/
I am a newbie to perl script (first timer and no programming of anytype in well over a decade) and really had a time of it without being able to see the data passed but finally figured out where the code errors lied. Now with the newer Linux Distro's, go to system settings and file associations and add under text the file type instead of it as a separate program. Elsewhere the guide linked is pretty good.
Once this is all done you can open a file browser and double click any .url file created by IE11 with no issue.
Edit; This only opens the URL, does not import cookies etc..
Proper code to use is
Edit 2;Code:#!/usr/bin/perl # Script to make Microsoft Windows Internet Shortcuts (*.url) work on Linux. # Open up the file open(F,"<$ARGV[0]") or die "$0: Could not load Internet Shortcut file $ARGV[0]!\n"; # Find the URL while($in = <F> and not $url) { chomp($in); if($in =~ m/\s*BASEURL\s*\=\s*\S*\s/) { $url = $in; $url =~ s/\s*BASEURL\s*\=\s*//; # Filter out the beginning stuff $url =~ s/\s*15+//; # Filter out the nasty DOS carriage return! } } system "firefox $url &";# or die "$0: Could not open $netscape\n"
It seems some older links do not include the BASEURL so next post/edit to this script will be to get those running as well.
-
-
HI, added code to also open where URL is only there and no BASEURL. for some reason you will find by default these older files do not open by script so you may have to tell them to open this again as well to the script file. For those coders out there I could not get ELSE IF to work but this does fine.
Code:#!/usr/bin/perl # Script to make Microsoft Windows Internet Shortcuts (*.url) work on Linux. # Open up the file open(F,"<$ARGV[0]") or die "$0: Could not load Internet Shortcut file $ARGV[0]!\n"; # Find the URL while($in = <F> and not $url) { chomp($in); if($in =~ m/\s*BASEURL\s*\=\s*\S*\s/) { $url = $in; $url =~ s/\s*BASEURL\s*\=\s*//; # Filter out the beginning stuff $url =~ s/\s*15+//; # Filter out the nasty DOS carriage return! } if ($in =~ m/\s*URL\s*\=\s*\S*\s/ and not $url) { $url = $in; $url =~ s/\s*URL\s*\=\s*//; # Filter out the beginning stuff $url =~ s/\s*15+//; # Filter out the nasty DOS carriage return! } } system "firefox $url &";# or die "$0: Could not open $netscape\n"
There are some characters that can't open, this can be an issue with some links.
Edit 2;
It seems if you already have a tab open then the script can hang for 10-20 seconds in the taskbar. If you do not mind opening the link in a new window this prevents the script hanging in the taskbar. Just substitute the code below for the last line.
Code:system "firefox -new-window $url &"
Last edited: Jul 4, 2015 -
I decided locally to do this as two script files. One has the new window option the other does not letting it open into a new tab. I have called these respectively "URL-New Window" and "URL-New Tab". I used open with to get both files as defaults with the new window being the double click. This way I have either option available.
-
One more thing, not everyone uses FireFox. So below is code for the default browser for the last line. But since parameters can change this is just to pass the URL. Again the is the last line and system call
Code:system "x-www-browser $url &"
Script to open .url files from IE 11
Discussion in 'Linux Compatibility and Software' started by TANWare, Jul 3, 2015.