From 09e7ddba9e9e38ca5387519f5bbc8db324f2aa5d Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Fri, 29 Nov 2024 10:40:22 +0100 Subject: [PATCH] web apps: add autocomplete attribute for usernames and passwords hinted at by chromium developer console --- webaccount/account.js | 2 +- webaccount/account.ts | 3 ++- webadmin/admin.js | 2 +- webadmin/admin.ts | 2 +- webmail/webmail.js | 2 +- webmail/webmail.ts | 3 ++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/webaccount/account.js b/webaccount/account.js index e30e6c4..526dc6b 100644 --- a/webaccount/account.js +++ b/webaccount/account.js @@ -913,7 +913,7 @@ const login = async (reason) => { finally { fieldset.disabled = false; } - }, fieldset = dom.fieldset(dom.h1('Account'), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Email address', style({ marginBottom: '.5ex' })), autosize = dom.span(dom._class('autosize'), username = dom.input(attr.required(''), attr.placeholder('jane@example.org'), function change() { autosize.dataset.value = username.value; }, function input() { autosize.dataset.value = username.value; }))), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Password', style({ marginBottom: '.5ex' })), password = dom.input(attr.type('password'), attr.required(''))), dom.div(style({ textAlign: 'center' }), dom.submitbutton('Login'))))))); + }, fieldset = dom.fieldset(dom.h1('Account'), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Email address', style({ marginBottom: '.5ex' })), autosize = dom.span(dom._class('autosize'), username = dom.input(attr.required(''), attr.autocomplete('username'), attr.placeholder('jane@example.org'), function change() { autosize.dataset.value = username.value; }, function input() { autosize.dataset.value = username.value; }))), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Password', style({ marginBottom: '.5ex' })), password = dom.input(attr.type('password'), attr.autocomplete('current-password'), attr.required(''))), dom.div(style({ textAlign: 'center' }), dom.submitbutton('Login'))))))); document.body.appendChild(root); username.focus(); }); diff --git a/webaccount/account.ts b/webaccount/account.ts index 631f9cb..5144299 100644 --- a/webaccount/account.ts +++ b/webaccount/account.ts @@ -61,6 +61,7 @@ const login = async (reason: string) => { autosize=dom.span(dom._class('autosize'), username=dom.input( attr.required(''), + attr.autocomplete('username'), attr.placeholder('jane@example.org'), function change() { autosize.dataset.value = username.value }, function input() { autosize.dataset.value = username.value }, @@ -70,7 +71,7 @@ const login = async (reason: string) => { dom.label( style({display: 'block', marginBottom: '2ex'}), dom.div('Password', style({marginBottom: '.5ex'})), - password=dom.input(attr.type('password'), attr.required('')), + password=dom.input(attr.type('password'), attr.autocomplete('current-password'), attr.required('')), ), dom.div( style({textAlign: 'center'}), diff --git a/webadmin/admin.js b/webadmin/admin.js index 8dacf74..627f5b3 100644 --- a/webadmin/admin.js +++ b/webadmin/admin.js @@ -1676,7 +1676,7 @@ const login = async (reason) => { finally { fieldset.disabled = false; } - }, fieldset = dom.fieldset(dom.h1('Admin'), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Password', style({ marginBottom: '.5ex' })), password = dom.input(attr.type('password'), attr.required(''))), dom.div(style({ textAlign: 'center' }), dom.submitbutton('Login'))))))); + }, fieldset = dom.fieldset(dom.h1('Admin'), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Password', style({ marginBottom: '.5ex' })), password = dom.input(attr.type('password'), attr.autocomplete('current-password'), attr.required(''))), dom.div(style({ textAlign: 'center' }), dom.submitbutton('Login'))))))); document.body.appendChild(root); password.focus(); }); diff --git a/webadmin/admin.ts b/webadmin/admin.ts index c953f4b..4d1e47d 100644 --- a/webadmin/admin.ts +++ b/webadmin/admin.ts @@ -54,7 +54,7 @@ const login = async (reason: string) => { dom.label( style({display: 'block', marginBottom: '2ex'}), dom.div('Password', style({marginBottom: '.5ex'})), - password=dom.input(attr.type('password'), attr.required('')), + password=dom.input(attr.type('password'), attr.autocomplete('current-password'), attr.required('')), ), dom.div( style({textAlign: 'center'}), diff --git a/webmail/webmail.js b/webmail/webmail.js index 733b139..4535659 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -1725,7 +1725,7 @@ const login = async (reason) => { finally { fieldset.disabled = false; } - }, fieldset = dom.fieldset(dom.h1('Mail'), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Email address', style({ marginBottom: '.5ex' })), autosize = dom.span(dom._class('autosize'), username = dom.input(attr.required(''), attr.placeholder('jane@example.org'), function change() { autosize.dataset.value = username.value; }, function input() { autosize.dataset.value = username.value; }))), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Password', style({ marginBottom: '.5ex' })), password = dom.input(attr.type('password'), attr.required(''))), dom.div(style({ textAlign: 'center' }), dom.submitbutton('Login'))))))); + }, fieldset = dom.fieldset(dom.h1('Mail'), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Email address', style({ marginBottom: '.5ex' })), autosize = dom.span(dom._class('autosize'), username = dom.input(attr.required(''), attr.autocomplete('username'), attr.placeholder('jane@example.org'), function change() { autosize.dataset.value = username.value; }, function input() { autosize.dataset.value = username.value; }))), dom.label(style({ display: 'block', marginBottom: '2ex' }), dom.div('Password', style({ marginBottom: '.5ex' })), password = dom.input(attr.type('password'), attr.autocomplete('current-password'), attr.required(''))), dom.div(style({ textAlign: 'center' }), dom.submitbutton('Login'))))))); document.body.appendChild(root); username.focus(); }); diff --git a/webmail/webmail.ts b/webmail/webmail.ts index ea265a8..3c24cdd 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -324,6 +324,7 @@ const login = async (reason: string) => { autosize=dom.span(dom._class('autosize'), username=dom.input( attr.required(''), + attr.autocomplete('username'), attr.placeholder('jane@example.org'), function change() { autosize.dataset.value = username.value }, function input() { autosize.dataset.value = username.value }, @@ -333,7 +334,7 @@ const login = async (reason: string) => { dom.label( style({display: 'block', marginBottom: '2ex'}), dom.div('Password', style({marginBottom: '.5ex'})), - password=dom.input(attr.type('password'), attr.required('')), + password=dom.input(attr.type('password'), attr.autocomplete('current-password'), attr.required('')), ), dom.div( style({textAlign: 'center'}),