I find really interesting the capability of mozilla to open new URLs in new tabs of a already running mozilla process. Still i find the syntax of the command awkward and not really usable. So I added the following snippet to my PATH. It's really simple, but makes the trick.
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, $_);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: mozilla -remote made simple
by Helter (Chaplain) on Oct 10, 2002 at 13:00 UTC | |
Re: mozilla -remote made simple
by mirod (Canon) on Oct 10, 2002 at 13:51 UTC | |
Re: mozilla -remote made simple
by Aristotle (Chancellor) on Dec 24, 2002 at 16:38 UTC | |
by Anonymous Monk on Jan 15, 2004 at 17:00 UTC | |
by b10m (Vicar) on Jan 15, 2004 at 17:11 UTC | |
Re: mozilla -remote made simple
by Aristotle (Chancellor) on Oct 10, 2002 at 18:34 UTC | |
Re: mozilla -remote made simple
by Mr. Muskrat (Canon) on Oct 10, 2002 at 14:02 UTC | |
Re: mozilla -remote made simple
by Mr. Muskrat (Canon) on Oct 30, 2002 at 16:48 UTC |
Back to
Cool Uses for Perl