diff --git a/api/js/jsapi/egw.js b/api/js/jsapi/egw.js index 6fb66bf2f8..4b15106854 100644 --- a/api/js/jsapi/egw.js +++ b/api/js/jsapi/egw.js @@ -474,6 +474,11 @@ window.app = {classes: {}}; parseInt(egw_script.getAttribute('data-websocket-account_id')) ); } + + // register our mail as mailto protocol handler + let url = egw_webserverUrl; + if (url[0] === '/') url = document.location.protocol+'://'+document.location.hostname+(url !== '/' ? url : ''); + navigator.registerProtocolHandler('mailto', url+'/index.php?menuaction=mail.mail_compose.compose&preset[mailto]=%s', 'Mail'); } catch(e) { // ignore SecurityError exception if top is different security context / cross-origin @@ -506,4 +511,4 @@ window.app = {classes: {}}; window.et2_call = function(_func) { return egw.applyFunc(_func, [].slice.call(arguments, 1), window); -} +} \ No newline at end of file