Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: mozilla -remote made simple

by Aristotle (Chancellor)
on Dec 24, 2002 at 16:38 UTC ( #222109=note: print w/ replies, xml ) Need Help??


in reply to mozilla -remote made simple

A bit tidier and more reliable:

#!/usr/bin/perl -w use strict; use constant URL => 'openURL(%s, new-tab)'; use constant MAIL => 'mailto(%s)'; sub abs_path { require File::Spec; File::Spec->rel2abs(shift); } $_ = shift || ''; my $command = m!^(?:ftp|http|file)://! ? sprintf URL, $_ : -r($_) ? sprintf URL, 'file://'.abs_path($_) : s!^(www\..+)!http://$1! ? sprintf URL, $_ : s!^(ftp\..+)!ftp://$1! ? sprintf URL, $_ : s/^mailto:// ? sprintf MAIL, $_ : die "usage: $0 (filename|URL|mailto:foo\@bar.com)\n"; exec 'mozilla', -remote => sprintf($command, $_);
This checks -r early - thus, you can use it to invoke Mozilla on a directory called www.foo.bar/ without the scheme guessing getting in your way. It also handles URLs with ftp.* hosts nicely.

Makeshifts last the longest.


Comment on Re: mozilla -remote made simple
Download Code
Re: Re: mozilla -remote made simple
by Anonymous Monk on Jan 15, 2004 at 17:00 UTC
    Do you know how to start Mozilla mail with the message text already filled in?

      Dunno if this works with all/more browsers, but it does seem to work with Firebird (and I hope this is what you're looking for):

      <a href="mailto:foo@bar.invalid?subject=Testing&body=Oh wow, body text +">foo@bar.invalid</a>

      This works for me, using Firebird and MozEX to launch Pine for me.

      Test it here :) foo@bar.invalid

      --
      b10m

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://222109]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-07-03 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls