mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
limit input types on autofill query
This commit is contained in:
parent
c6e5bd3b5f
commit
79deb5633a
@ -34,7 +34,7 @@
|
|||||||
1. Populate isFirefox
|
1. Populate isFirefox
|
||||||
2. Remove isChrome and isSafari since they are not used.
|
2. Remove isChrome and isSafari since they are not used.
|
||||||
3. Unminify and format to meet Mozilla review requirements.
|
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) {
|
function collect(document, undefined) {
|
||||||
@ -122,7 +122,7 @@
|
|||||||
// get the top label
|
// get the top label
|
||||||
function getLabelTop(el) {
|
function getLabelTop(el) {
|
||||||
var parent;
|
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;
|
el = el.parentElement || el.parentNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +432,7 @@
|
|||||||
|
|
||||||
function shiftForLeftLabel(el, arr, steps) {
|
function shiftForLeftLabel(el, arr, steps) {
|
||||||
var sib;
|
var sib;
|
||||||
for (steps || (steps = 0) ; el && el.previousSibling;) {
|
for (steps || (steps = 0); el && el.previousSibling;) {
|
||||||
el = el.previousSibling;
|
el = el.previousSibling;
|
||||||
if (isKnownTag(el)) {
|
if (isKnownTag(el)) {
|
||||||
return;
|
return;
|
||||||
@ -509,7 +509,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// walk the tree
|
// 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()
|
if (pointEl.tagName && 'string' === typeof pointEl.tagName && 'label' === pointEl.tagName.toLowerCase()
|
||||||
&& el.labels && 0 < el.labels.length) {
|
&& el.labels && 0 < el.labels.length) {
|
||||||
return 0 <= Array.prototype.slice.call(el.labels).indexOf(pointEl);
|
return 0 <= Array.prototype.slice.call(el.labels).indexOf(pointEl);
|
||||||
@ -551,7 +551,8 @@
|
|||||||
function getFormElements(theDoc) {
|
function getFormElements(theDoc) {
|
||||||
var els = [];
|
var els = [];
|
||||||
try {
|
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) { }
|
} catch (e) { }
|
||||||
return els;
|
return els;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user