
Mailgo, a new concept of mailto and tel links - manzinello
https://mailgo.dev
======
emersion
Would be better solved with a user-agent implementation I think. Let local
apps and webmails advertise support for mailto links, make the user-agent
display a dialog and let the user pick one.

We're almost there, the only issue is that there's no declarative way to
advertise support for mailto links, webmails need to ask the user.

~~~
browserface
Yes there is. It's called "navigator.registerProtocolHandler"[0]

[0]: [https://developer.mozilla.org/en-
US/docs/Web/API/Navigator/r...](https://developer.mozilla.org/en-
US/docs/Web/API/Navigator/registerProtocolHandler)

~~~
emersion
Not declarative, which means users would need to know they have to go to
settings and enable it.

~~~
untog
It shows a prompt to the user when you run the code, they don't need to go
near settings.

------
andreareina
Why? What's wrong with the standard behavior?

~~~
MatekCopatek
The fact that many people don't have the handling for it configured,
especially on desktop.

If you use a provider like gmail or hotmail, there's a chance they're not set
up as your mailto link handler. So in that case, some random email client you
have installed will open up and bug you with its first time setup wizard.

Best case, the user is annoyed but still manages to copy the address manually.
Worst case, they conclude the link is broken and don't use it.

~~~
bandie91
> If you use a provider like gmail or hotmail, there's a chance they're not
> set up as your mailto link handler.

so, they should set themself up. what drives someone into invent yet another
tool which accomplish something on a much higher cost, which is other
programms' responsibility and those could less painstakingly fix it.

~~~
judge2020
Gmail is doing this currently, at least for me (might still be in an A/B
stage). It'll pop up the browser permission to handle mail links, then chrome
will open the Windows 10 "default apps" page of settings to get you to change
the mail app to Chrome.

~~~
dudus
This is an old feature. But it requires Gmail asking for a permission or maybe
clicking on a setting somewhere and that means most users will ignore it or
simply dismiss it without understanding what it even is. These days there are
so many popups with warnings all the time (cookies, tos, notifications) you
can't blame the users for just dismissing them without even reading

------
gitgud
Demo is a pretty good user experience, but from my experience most people are
used to the standard behaviour, and would rather copy email addresses than
click hyperlinks...

[https://codepen.io/manzinello/pen/RmeQEr](https://codepen.io/manzinello/pen/RmeQEr)

~~~
dgellow
Hmm, the demoed elements don't seem to work on my phone. Nothing happens when
I select an item from the pop-over menu.

Is it just me or are others facing the same problem?

~~~
justusthane
Seems to work properly for me on iOS 13.6.1 (Safari & FF).

------
deanclatworthy
I hate to not be constructive here, but I don't have anything positive to say
really. A 7kb dependency for a non-standard popup. Maybe if you shrunk the
size down I'm sure some might find some use for it. But this is a lot to add,
for so little.

~~~
bandie91
and not only the size what does matter here. i bet whoever whats to use it, he
must time to time update the code, because some weird software bacteria tends
to rotten nowadays programms, so you can not just have written the simplest
few lines of code to solve one unit of requirement. no. you must update and
upgrade ad infinitum, creep the scope, refactor, add n×3 dependency for every
n feature. each update brings 2 new backdoors, breaks interface, etc, but
you're obligated to update because it's labelled "security update", obviously.

------
underlines
that's a very western centric view. in asia most people don't even use/know
email except some professionals. they would be overwhelmed with those choices.
also country specific would be the defaults. like japan is used to yahoo,
thailand used to Line messenger (nobody uses whatsapp here) etc.

~~~
browserface
That shouldn't be downvoted. That's a great point, even if most probably
misinterpret. In Asia people really don't use email as primary comms in B2C or
social for many things. People use LINE, WhatsApp, WeChat and other mail
providers like qq or 163.

Still it's a 'mailto:' link which might not translate to those media. But a
'tel:' link could possibly translate to "Connect with LINE" or other options.

Anyway I think this project is a very good idea. These sort of protocol links
are very useful, considering on mobile you are always app switching to share
something. Unfortunately, mobile browsers don't support
"navigator.registerProtocolHandler" but there might be workarounds for PWAs.

~~~
underlines
Thanks. I didn't mean to discredit the solution. I mean from my point of view
it's great. I use mailto: and tel: all the time. But I work in South East Asia
and East Asia in Web and Application analytics and the people here are very
different. The medium used for communication, the platforms, the way it's
being used, the devices are all very different. Just wanted to give another
perspective on this, to broaden the minds of the creators.

~~~
browserface
yeah exactly. good work

------
dndvr
Is this issue not somewhat solved by a the navigator.share API with a fallback
to a mailto: link (with no to address)

[https://developer.mozilla.org/en-
US/docs/Web/API/Navigator/s...](https://developer.mozilla.org/en-
US/docs/Web/API/Navigator/share)

NB support is somewhat limited:

[https://caniuse.com/web-share](https://caniuse.com/web-share)

------
FabianBeiner
One more click for anyone who is fine with their defaults. :/

------
amadeuspagel
I think the ideal solution would be to automatically copy the email into
clipboard on desktop and use a standard mailto link on mobile. On desktop,
most people use some kind of webmail, on mobile they have an app installed.
Yes you can configure your browsers to open mailto links with a webmail, but
almost no one does that.

~~~
kevsim
> Yes you can configure your browsers to open mailto links with a webmail, but
> almost no one does that.

Numbers? I always clicked "yes" to that prompt when I was using GMail as my
client. Maybe I'm weird?

~~~
amadeuspagel
I don't have any numbers, however there's a tool called hunter which finds
relevant email addresses for websites, and it uses copy to clipboard rather
then mailto. If even most people who know about and use such a tool don't have
mailto configured, probably almost no one has.

I don't know what prompt your talking about. Maybe an uncommon browser
feature?

~~~
kevsim
It's not uncommon. A web app can call navigator.registerProtocolHandler
([https://developer.mozilla.org/en-
US/docs/Web/API/Navigator/r...](https://developer.mozilla.org/en-
US/docs/Web/API/Navigator/registerProtocolHandler)) to become the default mail
handler. GMail does this.

~~~
amadeuspagel
Interesting. I use gmail, and I remember that mailto links bugged me forever,
until I set it up manually.

------
pirsquare
Great! This sort of "interactive link" is polite and what I wish more websites
would adopt instead of cluttering their site with fixed positioned widgets.

A good example is chat widget. Instead of using a fixed positioned chat widget
that annoys your users (esp those on mobile), why not stick to good old
"Contact Us" link that opens your chat widget only when it is clicked.

------
chrishannah
what problem does this solve?

~~~
leokennis
I like to mail from the Fastmail web interface. But I cannot set this as my
default mail application anywhere.

~~~
florian_buerger
You can as long as you use Chrome (or Brave or Edge) or Firefox
[https://www.fastmail.com/help/send/openemaillinks.html](https://www.fastmail.com/help/send/openemaillinks.html)

------
trumbitta2
I can see how this could be useful and appealing for businesses, especially
the phone part.

------
IntrospectEl
I think this is a good solution to a problem, but the demo doesn't illustrate
the more annoying version of the problem:

If I click an email address I expect the mailto behaviour (and to a lesser
extent with hyperlinked phone numbers) but often you'll see the case where the
hyperlink text actually just says "Contact" or similar and it opening my email
client is completely unexpected

------
dgellow
I find the spam-less version interesting, the risk of spam is a reason in
itself to not use mailto or tel links on your public pages, which is a sad in
itself.

------
r-w
Graceful degradation? Couldn't find any info on this.

~~~
justusthane
Test it. It's still just a mailto: link, so if you have JavaScript disabled it
functions like you would expect it to.

------
thedrake
please submit mailgo to [https://caniuse.com/](https://caniuse.com/) here
[https://caniuse.com/issue-list](https://caniuse.com/issue-list) or via github

~~~
detaro
It's a JS library, not a browser feature. What place does it have on caniuse?

