Files
autoreg-skills-max/skills/anti-detection-browser/templates/turnstile-patch/script.js

13 lines
498 B
JavaScript

// Override MouseEvent screenX/screenY to bypass CDP-based bot detection.
// Cloudflare Turnstile detects CDP browsers by checking for screenX=0, screenY=0
// which happens because CDP doesn't emulate real mouse coordinates.
Object.defineProperty(MouseEvent.prototype, 'screenX', {
get: function () {
return Math.floor(Math.random() * 400) + 800;
},
});
Object.defineProperty(MouseEvent.prototype, 'screenY', {
get: function () {
return Math.floor(Math.random() * 200) + 400;
},
});