Cursor Reset Trial

Reset Cursor Trial - Reset their Cursor trial period

目前为 2024-12-30 提交的版本。查看 最新版本

// ==UserScript==
// @name         Cursor Reset Trial
// @namespace    http://tampermonkey.net/
// @version      1.2
// @license MIT
// @description  Reset Cursor Trial - Reset their Cursor trial period
// @author       ovftank
// @homepage     https://github.com/ovftank/cursor-reset-trial/tree/main/tampermonkey-script
// @supportURL   https://github.com/ovftank
// @match        https://www.cursor.com/*
// @match        https://authenticator.cursor.sh/*
// @grant        GM_xmlhttpRequest
// @icon         https://github.com/ovftank/cursor-reset-trial/raw/refs/heads/main/images/icon.ico
// @contactURL   https://t.me/ovftank
// @copyright    2024, ovftank (https://gf.qytechs.cn/users/1392240-ovftank)
// ==/UserScript==

(()=>{"use strict";let t=()=>{let t=document.createElement("style");t.textContent=`
    .delete-account-button:hover,.toast-button:hover{box-shadow:0 4px 6px rgba(0,0,0,.2)}@keyframes toastFadeIn{from{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}.toast-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);backdrop-filter:blur(4px);z-index:99999;display:flex;align-items:center;justify-content:center}.toast-container{background-color:rgba(0,0,0,.9);color:#fff;padding:20px;border-radius:8px;min-width:300px;text-align:center;animation:.3s toastFadeIn;border:1px solid rgba(255,255,255,.1)}.delete-account-button,.toast-button{padding:8px 16px;box-shadow:0 2px 4px rgba(0,0,0,.1);transition:.3s;cursor:pointer}.toast-message{margin-bottom:16px;font-size:16px}.toast-buttons{display:flex;justify-content:center;gap:8px}.toast-button{border-radius:12px;color:#fff}.confirm-button{background-color:#fff;color:#000;border:none}.confirm-button:hover{background-color:#f0f0f0}.cancel-button{background-color:#666}.cancel-button:hover{background-color:#777}.delete-account-button{width:100%;margin-top:8px;background-color:#1a1a1a;border:1px solid #fff;color:#fff;border-radius:12px}.delete-account-button:hover{background-color:#2a2a2a}.loading-spinner{width:24px;height:24px;border:3px solid rgba(255,255,255,.3);border-radius:50%;border-top-color:#fff;animation:1s linear infinite spin;margin:0 auto;display:none}@keyframes spin{to{transform:rotate(360deg)}}.toast-message.loading .loading-spinner{display:block;margin-top:12px}
`,document.head.appendChild(t)},e=(t,e,o=!1)=>{let r=document.createElement("div");r.className="toast-overlay";let a=document.createElement("div");a.className="toast-container",a.innerHTML=`
    <div class=toast-message>${t}<div class=loading-spinner></div></div><div class=toast-buttons><button class="toast-button confirm-button">Confirm</button> <button class="toast-button cancel-button">Cancel</button></div>
`;let n=a.querySelector(".confirm-button"),s=a.querySelector(".cancel-button"),i=a.querySelector(".toast-message"),l=a.querySelector(".toast-buttons"),c=()=>{i.classList.add("loading"),l.style.display="none",i.textContent="Processing...";let t=document.createElement("div");t.className="loading-spinner",i.appendChild(t),e(r)};o?setTimeout(c,500):(n.addEventListener("click",c),s.addEventListener("click",()=>{document.body.removeChild(r)})),r.appendChild(a),document.body.appendChild(r)},o=(t,e,o=10)=>{let r=0,a=()=>{r++;let n=document.querySelector(t);if(n){e(n);return}r<o?setTimeout(a,1e3):console.log("Kh\xf4ng t\xecm thấy phần tử sau nhiều lần thử")};a()},r=t=>{GM_xmlhttpRequest({method:"POST",url:"https://www.cursor.com/api/dashboard/delete-account",headers:{"Content-Type":"application/json"},onload(e){if(200===e.status)document.body.removeChild(t),window.location.href="https://authenticator.cursor.sh";else{let o=t.querySelector(".toast-message"),r=t.querySelector(".toast-buttons");o.classList.remove("loading"),o.textContent="Failed to reset trial. Please try again.",r.style.display="flex"}},onerror(e){console.error("Error:",e);let o=t.querySelector(".toast-message"),r=t.querySelector(".toast-buttons");o.classList.remove("loading"),o.textContent="An error occurred. Please try again.",r.style.display="flex"}})},a=()=>{let t=window.location.href;"https://www.cursor.com/"===t?window.location.href="https://www.cursor.com/settings":t.startsWith("https://authenticator.cursor.sh/")?o("body > div.radix-themes > div > div > div:nth-child(2) > div > form > div > div.rt-Grid.rt-r-gap-3 > a:nth-child(2)",t=>{t.click()}):t.startsWith("https://www.cursor.com/loginDeepPage")&&o("body > main > section > div > div > div.flex.justify-end.gap-4 > button.relative.inline-flex.items-center.justify-center.whitespace-nowrap.rounded-lg.uppercase",t=>{t.click()})},n=()=>{if(t(),a(),window.location.href.startsWith("https://www.cursor.com/settings")){let n=new URLSearchParams(window.location.search),s="true"===n.get("reset");o("body > main > div > div > div > div > div > div.col-span-1.flex.flex-col.gap-2.xl\\:gap-4 > div:nth-child(1)",t=>{let o=document.createElement("button");o.innerHTML="Reset Trial",o.className="delete-account-button",o.addEventListener("click",()=>{e("Are you sure you want to reset your trial?",r)}),t.appendChild(o),s&&e("Are you sure you want to reset your trial?",r,!0)})}};n()})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址