科技 > 电脑产品 > 交换机

浏览器插件cursor实现自动注册、续杯的详细过程

6人参与 2025-06-25 交换机

无需下载、安装任何软件,浏览器实现无限续杯

我认为最强的武功就是用自己打败自己,就在刚刚根据从一个佬那里得来的思想,我决定用cursor打败cursor。让它帮我写一个关于自己的无限续杯浏览器插件。

不想听废话的直接获取插件,想听的可以看完,感谢!

插件下载地址cursor:https://minio.acowbo.fun/file/cursor-face.js
augment地址:https://minio.acowbo.fun/file/augment.js

继前面无限续杯的逻辑,这里再实现一个浏览器插件的无限续杯实现。

前言

在使用cursor这款基于ai的编程工具时,注册流程需要通过邮箱验证码来完成。这个过程虽然简单,但经常会遇到验证码获取不及时、填写不便等问题。为了解决这些痛点,我开发了一个简易的tampermonkey脚本,可以帮助用户自动填写邮箱、获取验证码并填入,大大提高注册效率。

功能概述

这个脚本主要提供以下功能:

使用方法

安装脚本

使用流程

脚本会根据当前页面自动显示相应的功能按钮:

邮箱输入页面

在邮箱输入页面,你会看到右上角有一个"填写邮箱并提交"按钮:

验证码页面

在验证码页面(url包含magic-code),你会看到三个功能按钮:

获取到验证码后,脚本会:

如果自动提交失败,脚本会添加一个"提交验证码"辅助按钮。

实战演示

最麻烦的其实就是随机邮箱,以及接受邮件验证码,所以我也只在这两步上做了文章

点击填写并提交,直接会填写邮箱并继续

虽然就是自己点击email sign-in code,然后过一个人机校验到下一个页面

这里别点强制获取新验证码和清空邮箱,这两个功能主要是防止邮箱多人在用。获取的验证码不是最新的。直接点击获取验证码就出现下面的图。

然后点击填入验证码就自动填入注册成功了。

注意:如果感觉邮箱前缀比较长,可以找到generateemail方法进行修改。

// 生成随机邮箱
    function generateemail() {
        const firstname = first_names[math.floor(math.random() * first_names.length)];
        const lastname = last_names[math.floor(math.random() * last_names.length)];
        const timestamp = date.now().tostring(36); // 转换为36进制以缩短长度
        const randomnum = math.floor(math.random() * 10000).tostring().padstart(4, '0'); // 生成4位随机数
        const username = `${firstname}${lastname}${timestamp}${randomnum}`;
        return `${username}${email_domain}`;
    }

将 const username = ${firstname}${lastname}${timestamp}${randomnum};去掉后面的即可。

技术实现

核心功能实现

1. 随机邮箱生成

脚本使用预定义的名字和姓氏列表,结合时间戳和随机数生成唯一的邮箱地址:

function generateemail() {
    const firstname = first_names[math.floor(math.random() * first_names.length)];
    const lastname = last_names[math.floor(math.random() * last_names.length)];
    const timestamp = date.now().tostring(36);
    const randomnum = math.floor(math.random() * 10000).tostring().padstart(4, '0');
    const username = `${firstname}${lastname}${timestamp}${randomnum}`;
    return `${username}${email_domain}`;
}

2. 验证码提取

脚本使用多种正则表达式模式来匹配邮件中的验证码,包括处理带空格的验证码:

function extractverificationcode(mailtext) {
    const patterns = [
        /code is:?\s*(\d[\s\d]{0,11}\d)/i,
        /one-time code is:?\s*(\d[\s\d]{0,11}\d)/i,
        /verification code[^\d]*(\d[\s\d]{0,11}\d)/i,
        /code[^\d]*(\d[\s\d]{0,11}\d)/i,
        /\b(\d[\s\d]{0,11}\d)\b/
    ];
    for (const pattern of patterns) {
        const match = mailtext.match(pattern);
        if (match) {
            const rawcode = match[1] || match[0];
            const cleancode = rawcode.replace(/\s+/g, '');
            if (/^\d{6}$/.test(cleancode)) {
                return cleancode;
            }
        }
    }
    return null;
}

3. 邮箱清空机制

脚本通过递归方式逐个删除邮件,确保邮箱完全清空:

async function clearmailbox() {
    // 先获取邮件列表
    const maillisturl = `https://tempmail.plus/api/mails?email=${username}${extension}&limit=50`;
    // 获取第一封邮件id
    const firstid = maillistdata.first_id;
    // 删除该邮件
    const clearurl = `https://tempmail.plus/api/mails/${firstid}?email=${username}${extension}`;
    // 递归调用,直到邮箱清空
    clearmailbox().then(resolve).catch(reject);
}

4. 验证码填写

脚本支持多种验证码输入框格式,包括分离式输入框:

function fillseparatecodeinputs(code) {
    // 查找所有可能的验证码输入框
    const codeinputselectors = [
        'input[maxlength="1"][pattern="\\d{1}"]',
        'input[data-test="otp-input"]',
        'input[data-index]',
        '.rt-textfieldinput[maxlength="1"]'
    ];
    // 逐个填入验证码
    for (let i = 0; i < codeinputs.length; i++) {
        const digit = code.charat(i);
        const input = codeinputs[i];
        input.value = digit;
        input.dispatchevent(new event('input', { bubbles: true }));
        input.dispatchevent(new event('change', { bubbles: true }));
    }
    // 更新隐藏的code输入框
    const hiddencodeinput = document.queryselector('input[name="code"][type="hidden"]');
    if (hiddencodeinput) {
        hiddencodeinput.value = code;
    }
}

用户界面

脚本提供了友好的用户界面,包括:

技术亮点

常见问题

1. 为什么需要清空邮箱?

清空邮箱是为了确保每次获取的都是最新的验证码,避免获取到旧的验证码。特别是在多次尝试注册时,邮箱中可能存在多个验证码邮件。

2. 验证码无法自动填入怎么办?

如果验证码无法自动填入,可以:

3. 如何确保获取最新的验证码?

如果担心获取的不是最新验证码,可以:

总结

这个cursor简易注册助手脚本通过自动化邮箱填写和验证码获取流程,大大简化了cursor的注册过程。它不仅提高了注册效率,还通过友好的用户界面和详细的日志系统,为用户提供了良好的使用体验。

无论你是首次注册cursor,还是需要创建多个账号,这个脚本都能帮你节省大量时间和精力。

后续优化方向

希望这个脚本能帮助你更便捷地使用cursor这个强大的ai编程工具!

到此这篇关于浏览器插件cursor实现自动注册、续杯的详细过程的文章就介绍到这了,更多相关cursor自动注册续杯内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

(0)

您想发表意见!!点此发布评论

推荐阅读

高颜值白金牌电源竟不到1元1W! 猎金部落Fire系列F10白金全模组电源评测

06-24

MESH网孔透风设计+体积小于初代! 先马趣造3手提式小机箱测评

06-24

品质、用料、颜值均为顶级,微星MEG Ai1600T PCIE5超神钛金电源测评

06-24

百盛高能XG1000电源测评: 轻松带动RTX5090

06-26

AMD锐龙7 9800X3D对比9700X差距大吗? 处理器性能对比测评

06-09

预装独家双螺旋风扇! 微星MPG VELOX 300R AIRFLOW PZ刀锋300机箱

06-09

猜你喜欢

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论