mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
convert nodelist to array
This commit is contained in:
@@ -551,8 +551,9 @@
|
|||||||
function getFormElements(theDoc, limit) {
|
function getFormElements(theDoc, limit) {
|
||||||
var els = [];
|
var els = [];
|
||||||
try {
|
try {
|
||||||
els = theDoc.querySelectorAll('input:not([type="hidden"]):not([type="submit"]):not([type="reset"])' +
|
var elsList = theDoc.querySelectorAll('input:not([type="hidden"]):not([type="submit"]):not([type="reset"])' +
|
||||||
':not([type="button"]):not([type="image"]):not([type="file"]), select');
|
':not([type="button"]):not([type="image"]):not([type="file"]), select');
|
||||||
|
els = Array.prototype.slice.call(elsList);
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
|
|
||||||
return limit && els.length > limit ? els.slice(0, limit) : els;
|
return limit && els.length > limit ? els.slice(0, limit) : els;
|
||||||
|
|||||||
Reference in New Issue
Block a user