Fixed too strong captcha detection
This commit is contained in:
+17
-6
@@ -31,12 +31,23 @@ async function detectCaptcha(page) {
|
||||
for (const selector of config.selectors) {
|
||||
const elements = document.querySelectorAll(selector);
|
||||
if (elements.length > 0) {
|
||||
results.push({
|
||||
type: type,
|
||||
name: config.name,
|
||||
selector: selector,
|
||||
count: elements.length
|
||||
});
|
||||
for (const el of elements) {
|
||||
const style = window.getComputedStyle(el);
|
||||
const rect = el.getBoundingClientRect();
|
||||
const isVisible = style.display !== 'none' &&
|
||||
style.visibility !== 'hidden' &&
|
||||
style.opacity !== '0' &&
|
||||
rect.width > 0 &&
|
||||
rect.height > 0;
|
||||
|
||||
results.push({
|
||||
type: type,
|
||||
name: config.name,
|
||||
selector: selector,
|
||||
count: elements.length,
|
||||
isVisible: isVisible
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user