trying to fix FF poping up install mailto-link message constantly, when changing content in an iframe / reading mail

This commit is contained in:
ralf 2022-07-25 08:35:34 +02:00
parent 79df51dbbb
commit 1058347c0a

View File

@ -475,11 +475,14 @@ window.app = {classes: {}};
); );
} }
// register our mail as mailto protocol handler // register our mail as mailto protocol handler (only for main-page, FF seems to pop it up constantly, if we do so in an iframe)
if (location.href.match(/(\?|&)cd=yes(&|$)/))
{
let url = egw_webserverUrl; let url = egw_webserverUrl;
if (url[0] === '/') url = document.location.protocol+'://'+document.location.hostname+(url !== '/' ? url : ''); 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'); navigator.registerProtocolHandler('mailto', url+'/index.php?menuaction=mail.mail_compose.compose&preset[mailto]=%s', 'Mail');
} }
}
catch(e) { catch(e) {
// ignore SecurityError exception if top is different security context / cross-origin // ignore SecurityError exception if top is different security context / cross-origin
} }