From 58a4c60f8329e56a5f99e1476ca3663305c77bac Mon Sep 17 00:00:00 2001 From: Procyon-b <40043075+Procyon-b@users.noreply.github.com> Date: Thu, 9 Aug 2018 08:25:57 -0400 Subject: [PATCH] Fixes per discussion in #16 Updated CSS selector, and using === with this.now in spoilFormGet --- src/content.js | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) mode change 100755 => 100644 src/content.js diff --git a/src/content.js b/src/content.js old mode 100755 new mode 100644 index 9ac6a67..8b806c4 --- a/src/content.js +++ b/src/content.js @@ -21,7 +21,6 @@ function applyFix(elem) { // Add an extra child input to any form that only has one function spoilFormGet(elem) { if(DEBUG) { - // cleaning debug output. comment out, this is displayed in "unspoiled": //console.info({t:this, Found: elem}); ++numseen; unspoiled.push(elem); } @@ -36,22 +35,23 @@ function spoilFormGet(elem) { // Autodetection requires exactly one input of type text or search // If the type attribute is missing, it defaults to `text` // Readonly inputs do not count against this total - if(elem.querySelectorAll(':scope input:-webkit-any([type="text" i],[type="search" i],:not([type])):not([readonly])[name]').length !== 1) return; + if(elem.querySelectorAll(':scope input:-webkit-any([type="text" i],[type="search" i],:not([type])):not([readonly])[name]:not([name=""])').length !== 1) return; // Autodetection also requires no password, file, or textarea elements if(elem.querySelector(':scope :-webkit-any(input[type="password" i],input[type="file" i],textarea)')) return; // Add a