From: Mike Frysinger Date: Sun, 5 Jan 2020 07:15:35 +0000 (+0545) Subject: options: improve field handling X-Git-Tag: v3.0 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e09bdd59a2ee6ed310948665a41b9cdfa21990ea;p=chrome-ext%2Fweb-power-switch.git options: improve field handling Don't allow Chrome to try to spellcheck/autocorrect these values. Make the password field more like a standard password field. --- diff --git a/options.html b/options.html index f9cac46..263a898 100644 --- a/options.html +++ b/options.html @@ -12,13 +12,19 @@ - + + - + + - + +
URL:URL:
User:User:
Pass:Pass: 
diff --git a/options.js b/options.js index bda3038..e1c9702 100644 --- a/options.js +++ b/options.js @@ -48,6 +48,13 @@ function keydown(e) { } } +function toggle_visible_pass() { + const ele = document.getElementById('pass'); + ele.type = (ele.type == 'password') ? 'text' : 'password'; + // Disable form submission. + return false; +} + window.onload = function() { storage.get(settings_keys, function(settings) { var field = document.getElementById('save'); @@ -59,4 +66,5 @@ window.onload = function() { field.onkeydown = keydown; }); }); + document.getElementById('show-pass').onclick = toggle_visible_pass; };