Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser does not remember password during login

An earlier question mentioned a method using the el config in order to make the browser remember passwords. Howewer, the el config no longer exists in ExtJS 4.1.

Now, what should I do?

like image 470
ilhan Avatar asked Aug 15 '12 08:08

ilhan


People also ask

Why is my browser not saving my passwords?

If Chrome doesn't offer to save the password, make sure that the password-saving feature is actually enabled. To check this, go to Settings > Autofill > Password Manager. If the Offer to save passwords option is switched off, toggle it on. Now, Chrome will offer you to save passwords when you log in to any website.

Why did Chrome suddenly forget all my passwords?

Google Chrome has a setting that can be toggled (sometimes accidentally) that will delete all cookies every time the browser is closed. As of June 2022 in Chrome 103, the setting is located at Settings > Privacy and security > Cookies and other site data (or URL: chrome://settings/cookies ).


1 Answers

I believe it should be contentEl instead of el but I do this another way. You can build the entire thing with ExtJS directly. The only twist is that Ext fields will be created with the autocomplete=off attribute by default, so I use a derived class to override that.

Ext.define('ACField', {
    extend: 'Ext.form.field.Text',

    initComponent: function() {
        Ext.each(this.fieldSubTpl, function(oneTpl, idx, allItems) {
            if (Ext.isString(oneTpl)) {
                allItems[idx] = oneTpl.replace('autocomplete="off"', 'autocomplete="on"');
            }
        });
        this.callParent(arguments);
    }
});

Ext.onReady(function() {
    new Ext.panel.Panel({
        renderTo: Ext.getBody(),
        width: 300,
        height: 100,
        autoEl: {
            tag: 'form',
            action: 'login.php',
            method: 'post'
        },  
        items: [
            new ACField({
                xtype: 'textfield',
                name: 'username',
                fieldLabel: 'Username'
            }), 
            new ACField({
                xtype: 'textfield',
                name: 'password',
                fieldLabel: 'Password',
                inputType: 'password'
            }), 
        ],
        buttons: [{
            xtype: 'button',
            text: 'Log in',
            type: 'submit',
            preventDefault: false
        }]
    });
});
like image 155
lagnat Avatar answered Sep 20 '22 20:09

lagnat