ana.rodrigues Posted September 24, 2020 Share Posted September 24, 2020 Hi, I am developing an unigui application, and i would like not show saved passwords or users from google chrome. I tried some solutions i read on forumns but none worked, such as UniSession.AddJS('$("input").attr("autocomplete", "off"); or function afterrender(sender, eOpts) { var me=sender.inputEl; me.set({ readonly: "readonly" }); sender.addListener( 'focus', function(sender, e, eOpts) { me.el.dom.removeAttribute('readonly'); } ); } How can i disable, saved passwords from appear, everytime i use an edit? Thanks in advance. 1 1 Quote Link to comment Share on other sites More sharing options...
alfr Posted September 24, 2020 Share Posted September 24, 2020 Perhaps this way (from another forum post)? On 3/17/2017 at 8:06 PM, Sherzod said: Hi, Ok, can you try to use this approach?!: In your password edit box: 1. P1 -> ClientEvents -> ExtEvents -> function afterrender: function afterrender(sender, eOpts) { var me=sender.inputEl; me.set({ readonly: "readonly" }); } 2. P1 -> ClientEvents -> ExtEvents -> function focus: function focus(sender, e, eOpts) { var me=sender.inputEl; me.el.dom.removeAttribute('readonly'); } Best regards. 1 Quote Link to comment Share on other sites More sharing options...
Pep Posted September 24, 2020 Share Posted September 24, 2020 See this video (minute 33.10) to remove autofill. 1 Quote Link to comment Share on other sites More sharing options...
ana.rodrigues Posted September 24, 2020 Author Share Posted September 24, 2020 13 minutes ago, alfr said: Perhaps this way (from another forum post)? I tried that, didn't do anything at all, unfortunatelly... Quote Link to comment Share on other sites More sharing options...
picyka Posted September 24, 2020 Share Posted September 24, 2020 7 hours ago, ana.rodrigues said: Eu tentei isso, não fiz nada, infelizmente ... It doesn't really work! Quote Link to comment Share on other sites More sharing options...
andyhill Posted September 24, 2020 Share Posted September 24, 2020 I would also like to forbid the Password Manager (not via the browser settings) via javascript to ignore my UniGui password objects, can someone please advise - thanks. 1 Quote Link to comment Share on other sites More sharing options...
ana.rodrigues Posted September 25, 2020 Author Share Posted September 25, 2020 19 hours ago, Pep said: See this video (minute 33.10) to remove autofill. Hi, thanks but i saw this video and does not explain how to remove the autofill. The author says that explanation is in another video, but he doesn't say which video has the explanation. Also, the rar file is damaged, don´t know if it has the source code or not. Quote Link to comment Share on other sites More sharing options...
Pep Posted September 26, 2020 Share Posted September 26, 2020 Can you try to use this approach? In UniServerModule.CustomCSS property .txtPassword { -webkit-text-security:disc; } for more information about this: https://stackoverflow.com/questions/13822548/degrading-webkit-text-security In Login Form: edtPassword.ClietnEvents.UniEvents -> beforeInit: function beforeInit(sender, config) { config.cls = 'txtPassword'; config.readOnly = true; config.listeners={ focus: function(edt) { edt.setReadOnly(false); } } } UniLoginFormCreate Event procedure TfrmLogin.UniLoginFormCreate(Sender: TObject); begin // Set edtPassword as Input Type = "password" edtPassword.PasswordChar := '*'; UserAgent.Caption := 'User Agent: ' + UniSession.UserAgent; if UniSession.UserAgent <> EmptyStr then begin if (Pos('chrome', LowerCase(UniSession.UserAgent))> 0) then begin // Browser is chrome and it's comptaible with css property -webkit-text-security:disc; // so you can set edtPassword Input Type = "text" edtPassword.PasswordChar := #0; end; end; end; See demo app: DemoLogin.7z 1 Quote Link to comment Share on other sites More sharing options...
mhmda Posted September 26, 2020 Share Posted September 26, 2020 Please see 35:36 The client-side code "focus" event and "readOnly" property that I set to true as initial value. 1 Quote Link to comment Share on other sites More sharing options...
andyhill Posted September 26, 2020 Share Posted September 26, 2020 Thank You Pep, just what I needed Quote Link to comment Share on other sites More sharing options...
ana.rodrigues Posted September 28, 2020 Author Share Posted September 28, 2020 On 9/26/2020 at 12:48 PM, Pep said: Can you try to use this approach? In UniServerModule.CustomCSS property .txtPassword { -webkit-text-security:disc; } for more information about this: https://stackoverflow.com/questions/13822548/degrading-webkit-text-security In Login Form: edtPassword.ClietnEvents.UniEvents -> beforeInit: function beforeInit(sender, config) { config.cls = 'txtPassword'; config.readOnly = true; config.listeners={ focus: function(edt) { edt.setReadOnly(false); } } } UniLoginFormCreate Event procedure TfrmLogin.UniLoginFormCreate(Sender: TObject); begin // Set edtPassword as Input Type = "password" edtPassword.PasswordChar := '*'; UserAgent.Caption := 'User Agent: ' + UniSession.UserAgent; if UniSession.UserAgent <> EmptyStr then begin if (Pos('chrome', LowerCase(UniSession.UserAgent))> 0) then begin // Browser is chrome and it's comptaible with css property -webkit-text-security:disc; // so you can set edtPassword Input Type = "text" edtPassword.PasswordChar := #0; end; end; end; See demo app: DemoLogin.7z Thank you. It worked! Quote Link to comment Share on other sites More sharing options...
x11 Posted December 2, 2020 Share Posted December 2, 2020 function afterrender(sender, eOpts) { var me = sender.inputEl; me.el.dom.setAttribute('autocomplete', 'current-password'); me.el.dom.setAttribute('name', 'current-password'); } https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-current-password Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.