diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index d9f0b423d7..485fe22553 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -596,6 +596,16 @@ etemplate2.prototype.autocomplete_fixer = function () { var self = this; var form = self.DOMContainer; + + // Safari always do the autofill for password field regardless of autocomplete = off + // and since there's no other way to switch the autocomplete of, we should switch the + // form autocomplete off (e.g. compose dialog, attachment password field) + if (navigator.userAgent.match(/safari/i) && !navigator.userAgent.match(/chrome/i) + && jQuery('input[type="password"]').length > 0) + { + return; + } + if (form) { // Stop submit propagation in order to not fire other possible submit events