这是indexloc提供的服务,不要输入任何密码
Skip to content

feat: 优化脚本稳定性并增加中文注释 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

Silentely
Copy link
Contributor

1、解决了 await 语法错误

2、将整个脚本包裹在 (function() { 'use strict'; ... })(); 结构中,启用严格模式并避免污染全局作用域。

3、在与 Cloudflare Turnstile 交互的部分,当 MutationObserver 监听到令牌生成并成功点击提交后,会调用 observer.disconnect() 来停止监听,避免不必要的资源消耗。

4、增加了对页面元素(如 jQuery 的 $)是否存在的检查,使脚本在不同加载情况下更加稳定。

5、为脚本的每个核心功能模块(登录、检查到期、续期、验证码处理)添加了详细的中文注释。

6、在脚本头部增加了清晰的 “使用说明” 和 “工作流程”,方便新用户快速理解和上手。

7、在 UserScript 元数据中添加了 @name:zh-CN 和 @description:zh-CN 字段,优化了脚本在中文环境下的显示。

@GitHub30
Copy link
Owner

真的非常感谢您。我不知道如何使用 Puppeteer 来解决 Cloudflare Turnstile。

@GitHub30 GitHub30 merged commit b51498f into GitHub30:main Jul 21, 2025
@Silentely
Copy link
Contributor Author

真的非常感谢您。我不知道如何使用 Puppeteer 来解决 Cloudflare Turnstile。

我也试过,action 模拟的会被识别卡在复选框那里,但是脚本的可以,属于是半自动了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants