diff --git a/src/content.js b/src/content.js index 702b9c4..9ac6a67 100755 --- a/src/content.js +++ b/src/content.js @@ -2,7 +2,7 @@ const DEBUG=true; let numseen=0, numspoiled=0; let unspoiled=[]; -// called when the user clicks an element of the form (any field or button). The parameter passed if the event object +// called when the user clicks an element of the form (any field or button). The parameter passed is the event object function clickApply(e) { if(DEBUG) console.info({'form onclick':e}); // remove onclick. One fix only @@ -21,7 +21,7 @@ function applyFix(elem) { // Add an extra child input to any form that only has one function spoilFormGet(elem) { if(DEBUG) { - console.info({t:this, Found: elem}); + // cleaning debug output. comment out, this is displayed in "unspoiled": //console.info({t:this, Found: elem}); ++numseen; unspoiled.push(elem); } @@ -36,14 +36,14 @@ 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])').length !== 1) return; + if(elem.querySelectorAll(':scope input:-webkit-any([type="text" i],[type="search" i],:not([type])):not([readonly])[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