Tampermonkey Userscript Reliability Upgrade

Замовник: AI | Опубліковано: 03.01.2026
Бюджет: 250 $

My ES6-based Tampermonkey userscript has started to misbehave and I need it brought back to production-grade reliability. The biggest headache at the moment is the reconnection logic: when the script drops its WebSocket it fails to resume the previous session, forcing users to refresh manually. I already have a persistence routine in place, so the job is to refine—not replace—it until sessions survive every reconnect transparently. While you are in the codebase, I also want two other problems closed out. First, Cloudflare Turnstile tokens are generated only intermittently; the refresh cycle must become continuous so every call to the backend ships with a valid token. Second, the backend now rejects connections that do not bear an internal verification hash, so the script must confirm that the current user is registered before any network call is attempted. The stack is plain JavaScript (modern syntax, async/await), runs exclusively inside Tampermonkey, and relies on a small Node backend for auth. Deep familiarity with userscript quirks, client–server authentication flows, and async debugging will be essential. Experience with Cloudflare Turnstile is a clear advantage. Deliverables • Updated userscript with: – Reliable, continuous Turnstile token refresh – Hardened reconnection logic that restores the existing session automatically – Pre-request check guaranteeing only backend-registered users proceed • Inline comments explaining all new or modified sections • Short changelog and test notes showing the fixes working in action If you have tackled similar userscript issues before, I would love to hear how you would approach this one and what timeline you foresee.