mailto: link in XUL

Talk about add-ons and extension development.
Post Reply
ericjung
Posts: 846
Joined: August 4th, 2003, 9:32 am

mailto: link in XUL

Post by ericjung »

Hi,
I'm looking for a way to create a <b>mailto:</b> link in XUL which doesn't first open a window. Right now I have this:

Code: Select all

<text value="mail the author" style="color: blue; cursor: pointer" onclick="window.open('mailto:foobar@yahoo.com?subject=firefox');"/>

but this code opens an empty browser and then opens my email application's message composer. Is there a way to say something like:

Code: Select all

onclick="mailto:foobar@yahoo.com?subject=firefox;"

note the lack of window.open()?

Thank you in advance for any help,
grimholtz
asqueella
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post by asqueella »

take a look at MailIntegration object in browser.js, it may help you.
ericjung
Posts: 846
Joined: August 4th, 2003, 9:32 am

Post by ericjung »

Thanks, asqueella.

I created an article about it here, but I don't know how to categorize it. Can you tell me? Last time you just did it for me (here), but you never told me what to do. Try as I might, I can't figure it out... so I'm asking yet again.

-grimholtz
asqueella
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post by asqueella »

That's a good question. You correctly linked it from Example code page, but it's not clear whether we want to use the Dev : Extensions : ... prefix. The name you chose is ok for the time being.
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

Sorry for bumping a really old thread, but does this not work? (Did it not work when you guys were discussing this?)

Code: Select all

 <label href="mailto:me@example.com" class="text-link">Mail me</label>
ericjung
Posts: 846
Joined: August 4th, 2003, 9:32 am

Post by ericjung »

Don't remember (that was 1 yr 7 months ago!). How old is the href attribute?
old np
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old np »

ericjung
Posts: 846
Joined: August 4th, 2003, 9:32 am

Post by ericjung »

Doh!
Post Reply