I want get all checkboxes from a html page. I use window.get_elements but window.get_elements() trigger a JS TypeError. The error happens with elements selectionDirection, selectionStart and selectionEnd in the checkbox node.
A fast way to fix that are adding a try... catch in copyJSON (in js/dom.py) like
` var copyJSON = function(node, opts) {
var copy = {};
for (var n in node) {
try {
if (typeof node[n] !== "undefined" && typeof node[n] !== "function" && n.charAt(0).toLowerCase() === n.charAt(0)) {
if (typeof node[n] !== "object" || node[n] instanceof Array) {
if (opts.cull) {
if (node[n] || node[n] === 0 || node[n] === false) {
copy[n] = node[n];
}
} else {
copy[n] = node[n];
}
}
}
} catch {
console.log(n);
}
}
copy = boolFilter(copy, opts.domProperties);
return copy;
};
`
But, this don't fix the bug, just hide it. But i have no idea how fix that... and if can be fixed.
The text was updated successfully, but these errors were encountered:
Specification
Description
I want get all checkboxes from a html page. I use window.get_elements but window.get_elements() trigger a JS TypeError. The error happens with elements selectionDirection, selectionStart and selectionEnd in the checkbox node.
A fast way to fix that are adding a try... catch in copyJSON (in js/dom.py) like
` var copyJSON = function(node, opts) {
`
But, this don't fix the bug, just hide it. But i have no idea how fix that... and if can be fixed.
The text was updated successfully, but these errors were encountered: