Как настроить Chrome, чтобы разрешать обработку ссылок mailto: Outlook.com?

934
Protector one

Когда вы заходите на gmail.com, Chrome просит вас разрешить обработку mailto:ссылок в gmail. На Outlook.com Microsoft забыла предоставить своим пользователям эту функцию. Как сделать это самостоятельно?

2

1 ответ на вопрос

4
Protector one

It's a bit of a convoluted process, but you can do it using navigator.registerProtocolHandler and a web site that rewrites the URL's query string a little.

Go to http://terrific-charger.glitch.me. This is a tiny Glitch project I wrote for which the code is below, but you can verify there is no hanky panky here: https://glitch.com/edit/#!/terrific-charger?path=script.js:1:0.

Open the Chrome console (ctrl+shift+j), then paste the following code into it and hit enter:

navigator.registerProtocolHandler('mailto','http://terrific-charger.glitch.me/?mailto=%s','Outlook.com'); 

Chrome will now tell you that "http://terrific-charger.glitch.me/ wants to Open email links". Click "Allow". That's it!

To undo the new behavior, go to: chrome://settings/handlers, and remove the listed handler using the three-dot menu.

Glitch code:

if (location.search.length) location = 'https://outlook.live.com/default.aspx?rru=compose&to=' + decodeURIComponent(location.search).slice('?mailto=mailto:'.length).replace('?','&'); 

Похожие вопросы