From e09bdd59a2ee6ed310948665a41b9cdfa21990ea Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 5 Jan 2020 13:00:35 +0545 Subject: [PATCH] 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. --- options.html | 12 +++++++++--- options.js | 8 ++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) 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; }; -- 2.39.2