NB: tested with Mozilla 1.1. It should work even with Mozilla 1.0 but i'm pretty sure it won't work for previous versions.
#!/usr/bin/perl use strict; use constant USAGE => <<EOU; USAGE: $0 (filename|URL|mailto:email\@addre.ss) EOU $_ = shift; my $command = 'openURL(%s, new-tab)'; SWITCH: { s!^(www\..+)!http://$1!; m!^(ftp|http|file)://! and last; s!^mailto:!! and do { $command = 'mailto(%s)'; last; }; -r and do { require Cwd; $_ = 'file://' . Cwd::abs_path( $_ ); last; }; print USAGE and exit; } system "mozilla", "-remote", sprintf($command, $_);
In reply to mozilla -remote made simple by giulienk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |