mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
limit input types on autofill query
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
1. Populate isFirefox
|
||||
2. Remove isChrome and isSafari since they are not used.
|
||||
3. Unminify and format to meet Mozilla review requirements.
|
||||
4. Remove button from getFormElements query selector
|
||||
4. Remove button and limit input types from getFormElements query selector
|
||||
*/
|
||||
|
||||
function collect(document, undefined) {
|
||||
@@ -122,7 +122,7 @@
|
||||
// get the top label
|
||||
function getLabelTop(el) {
|
||||
var parent;
|
||||
for (el = el.parentElement || el.parentNode; el && 'td' != toLowerString(el.tagName) ;) {
|
||||
for (el = el.parentElement || el.parentNode; el && 'td' != toLowerString(el.tagName);) {
|
||||
el = el.parentElement || el.parentNode;
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@
|
||||
|
||||
function shiftForLeftLabel(el, arr, steps) {
|
||||
var sib;
|
||||
for (steps || (steps = 0) ; el && el.previousSibling;) {
|
||||
for (steps || (steps = 0); el && el.previousSibling;) {
|
||||
el = el.previousSibling;
|
||||
if (isKnownTag(el)) {
|
||||
return;
|
||||
@@ -509,7 +509,7 @@
|
||||
}
|
||||
|
||||
// walk the tree
|
||||
for (var pointEl = el.ownerDocument.elementFromPoint(leftOffset + (rect.right > window.innerWidth ? (window.innerWidth - leftOffset) / 2 : rect.width / 2), topOffset + (rect.bottom > window.innerHeight ? (window.innerHeight - topOffset) / 2 : rect.height / 2)) ; pointEl && pointEl !== el && pointEl !== document;) {
|
||||
for (var pointEl = el.ownerDocument.elementFromPoint(leftOffset + (rect.right > window.innerWidth ? (window.innerWidth - leftOffset) / 2 : rect.width / 2), topOffset + (rect.bottom > window.innerHeight ? (window.innerHeight - topOffset) / 2 : rect.height / 2)); pointEl && pointEl !== el && pointEl !== document;) {
|
||||
if (pointEl.tagName && 'string' === typeof pointEl.tagName && 'label' === pointEl.tagName.toLowerCase()
|
||||
&& el.labels && 0 < el.labels.length) {
|
||||
return 0 <= Array.prototype.slice.call(el.labels).indexOf(pointEl);
|
||||
@@ -551,7 +551,8 @@
|
||||
function getFormElements(theDoc) {
|
||||
var els = [];
|
||||
try {
|
||||
els = theDoc.querySelectorAll('input, select');
|
||||
els = theDoc.querySelectorAll('input:not([type="hidden"]):not([type="submit"]):not([type="reset"])' +
|
||||
':not([type="button"]):not([type="image"]):not([type="file"]), select');
|
||||
} catch (e) { }
|
||||
return els;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user