mailto: links in Google Chrome

2,713 views
Skip to first unread message

melody

unread,
Sep 1, 2011, 3:37:55 PM9/1/11
to Google Web Toolkit
I am trying to implement mailto: links in my application. When I use
the mailto: link with the target attribute as shown below, the browser
opens the email program fine but closes my GWT program by moving the
browser to about:blank page.

<a href='mailto:mye...@mail.com'>Send Email</a>

The same link works fine in Firefox without closing my GWT application/
page.


If I use the following link with the TARGET attribute, the email
program is opened correctly but Google Chrome annoyingly opens a new
tab with the URL about:blank

<a href='mailto:mye...@mail.com' target='_blank'>Send Email</a>

Again the same links work fine in Firefox.

Is there a way around this Google Chrome problem with email links?

Thanks,

Melody

karim duran

unread,
Sep 1, 2011, 6:35:54 PM9/1/11
to google-we...@googlegroups.com
Hi Melody,

In my opinion you shouldn't use target attribute with an email link. Target attribute tells the browser how it should manage the link (e.g in the same window, in the parent window, in a new window). It's appropriate for Web browsing, not for email.

When the browser meet a email link mailto, it just asks the system to open your client mail software as you said.

I agree with you, it's strange that you are redirect to about:blank page. I can't reproduce this incident in a simple exemple. But my Google Chrome version is old.

Does this pb happen in dev/test mode ? Or in deploiement mode ?
May be you can try to use a GWT link instead of hard coded HTML mailto link.

I hope it helps.

Regards

Karim Duran

2011/9/1 melody <pedz...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Jeff Chimene

unread,
Sep 23, 2011, 2:26:23 PM9/23/11
to google-we...@googlegroups.com
On 09/23/2011 10:51 AM, melody wrote:
>>>>
> Does this pb happen in dev/test mode ? Or in deploiement mode ?
> <<<
> In production mode.

>
>>>>
> May be you can try to use a GWT link instead of hard coded HTML mailto
> link.
> <<<
> Can you kindly provide an example of what you mean by GWT link instead
> of HTML link. Keep in mind that I chose the HTML link in order to
> leave the execution/firing of the link to the browser instead of me
> explicitly firing it using GWT/Javascript which has the potential of
> being blocked by popup blockers.
>
> Thanks again for your response.
>

It looks like this is the intended behavior. When I load the following
via the file:// protocol, I can duplicate the effect. If I remove the
TARGET attribute, it does not change the url.

====
<head>
<title>mailto test</title>
</head>
<body>
<a target="_blank" href="mailto:jchi...@example.com">click here</a>
</body>
====

You might try removing the HREF attribute, adding an onClick handler,
that either
1) calls window.open to the appropriate URL;
or
2) creates an IFRAME and sets its URL to the appropriate value in the
onClick handler;

melody

unread,
Sep 23, 2011, 1:51:40 PM9/23/11
to Google Web Toolkit
>>>
Does this pb happen in dev/test mode ? Or in deploiement mode ?
<<<
In production mode.

>>>
May be you can try to use a GWT link instead of hard coded HTML mailto
link.
<<<
Reply all
Reply to author
Forward
0 new messages