how can i register the mailto:
protocol handler for the Yahoo Mail web client?
I know the javascript to run should be smt like this:
navigator.registerProtocolHandler('mailto', 'https://compose.mail.yahoo.com/?%s', 'Yahoo Mail');
The problem is, their email composition URL domain compose.mail.yahoo.com is not the same as their main one mail.yahoo.com, so running registerProtocolHandler
in the mail.yahoo.com inspector console gives the error:
Uncaught DOMException: Failed to execute ‘registerProtocolHandler’ on ‘Navigator’: Can only register custom handler in the document’s origin.
at :1:11
… and you can’t run it in a compose.mail.yahoo.com window because it immediately redirects away with an HTTP 302 to login.yahoo.com with an additional redirect (if you’re logged in) to mail.yahoo.com/d/compose.
So i can register such an handler? I just need to find a way to execute that javascript in the context of compose.mail.yahoo.com, i think..
2
Answers
I found an answer by myself, even though it's kind of an hack.
That is a generic login link with a post-login redirect to the double-urlencoded URL present in the
.done
parameter, which translates to the compose.mail.yahoo.com link needed for yahoo mail.Adjust the
&.lang=en-US&.intl=us
as needed to set your preferred language.I don't know what the other parameters are for, exactly.
I got this URL by checking what/how compose.mail.yahoo.com redirects to via
curl
:Another possibility would be to setup a little redirect page on a website you possess, with a simple script like: