mirror of
https://github.com/OLmatter/glm-coding-helper.git
synced 2026-10-07 15:28:19 +08:00
Root cause: v8.21 added a top-level `function jitterDelay()` helper.
In some Tampermonkey/cache scenarios the helper is undefined inside
the `handleCaptchaDirectInPage` async closure, throwing
`ReferenceError: jitterDelay is not defined`. The catch block then
resets `captchaSent = false` and `lastCaptchaText = ''`, so the
`setInterval(checkCaptchaPrompt, 50)` loop resends the same captcha
to the backend every 50ms ("dead loop sending captcha").
Fix: inline the ±20% jitter math at both call sites
(line 1814 and 1117), drop the helper entirely. Also added
`Number(...) || default` guards so a stale `CFG.CAPTCHA_CLICK_DELAY`
or `CFG.RL_RETRY_DELAY` of NaN/null/undefined falls back to the
DEF value rather than making `setTimeout(NaN)` fire instantly.
Side effect that confirmed the bug: the captcha bg element lost
its layout during the storm, so `rect.width = 0` and
`nx * rect.width = 0`, but `rect.left` was ~-9992 from a stale
frame ref — hence the marker spamming `(-9992, -10029)`.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
智谱 GLM Coding Plan 抢购助手用户脚本
这是智谱 GLM Coding Plan 抢购助手的油猴 / Tampermonkey 用户脚本,配合本地 CPU/GPU OCR 后端自动识别中文点选验证码并点击。
安装方式:
- 安装 Tampermonkey。
- 优先打开仓库根目录的
glm-coding-helper.user.js。 - 复制全部内容,新建 Tampermonkey 脚本并保存。
- 启动本地后端:
powershell -ExecutionPolicy Bypass -File scripts\start_backend.ps1 -Mode auto。
这个目录保留给开发和旧路径兼容。普通用户直接看仓库根目录的脚本文件即可。
默认后端地址为:
http://127.0.0.1:8888
脚本默认使用作者内置 GLM Coding Plan 折扣入口;如有需要可自行修改入口参数。
默认不自动关闭无效支付链接/限流弹窗,需要在配置面板里手动开启。
快捷键:
Esc:关闭系统繁忙弹窗或支付弹窗Enter/Space:点击验证码确认按钮