Refactor registration flow, update config, replace Turnstile patch
- Major refactor of grok_register_ttk.py: improved flow, error handling, logging - Update config.example.json and config.json with new fields - Replace turnstilePatch/content.js with new script.js approach - Update start.sh for better Chromium/Turnstile handling - Remove deprecated turnstilePatch/content.js
This commit is contained in:
1 parent
7a02453601
commit
c87b01967f
7 files changed
+794
-425
No files matched your search
@@ -0,0 +1,24 @@
|
||||
function getRandomInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
// CDP Input.dispatchMouseEvent creates MouseEvent where
|
||||
// .screenX/.screenY equal .clientX/.clientY. Cloudflare Turnstile detects
|
||||
// this (Chromium issue 40280325). Patch with realistic screen coords.
|
||||
// Source: ObjectAscended/CDP-bug-MouseEvent-.screenX-.screenY-patcher
|
||||
// Ported from ReinerBRO/grok-register + Git-creat7/grokRegister-cpa.
|
||||
|
||||
// old method wouldn't work on 4k screens
|
||||
let screenX = getRandomInt(800, 1200);
|
||||
let screenY = getRandomInt(400, 600);
|
||||
|
||||
Object.defineProperty(MouseEvent.prototype, "screenX", { value: screenX });
|
||||
Object.defineProperty(MouseEvent.prototype, "screenY", { value: screenY });
|
||||
|
||||
// Best-effort: also cover PointerEvent if present (CF may read either).
|
||||
try {
|
||||
if (typeof PointerEvent !== "undefined" && PointerEvent.prototype) {
|
||||
Object.defineProperty(PointerEvent.prototype, "screenX", { value: screenX });
|
||||
Object.defineProperty(PointerEvent.prototype, "screenY", { value: screenY });
|
||||
}
|
||||
} catch (e) {}
|
||||
Reference in new issue
Block a user