// ==UserScript== // @name anti-rickroll // @namespace http://tampermonkey.net/ // @version 11.1 // @description fuck rickroll // @author dext // @match *://*/* // @grant GM_xmlhttpRequest // @grant GM_addStyle // @connect anti-rickroll.dext.top // @run-at document-start // @downloadURL none // ==/UserScript== (function() { 'use strict'; const API_ENDPOINT = "https://anti-rickroll.dext.top"; const cache = new Map(); const queue = []; let activeRequests = 0; const MAX_CONCURRENT = 3; GM_addStyle(` #rick-breaker-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.95); z-index:2147483647; display:flex; justify-content:center; align-items:center; backdrop-filter:blur(15px); } .rick-card { background:#fff; padding:40px; border-radius:20px; width:350px; text-align:center; border:6px solid #ff4444; font-family:sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,0.5); } .rick-btn { padding:15px; border-radius:10px; cursor:pointer; border:none; font-weight:bold; width:100%; margin-top:15px; font-size:14px; } .btn-safe { background:#eee; color:#333; } .btn-danger { background:#ff4444; color:#fff; } a.rickroll-danger { border-bottom: 2px dashed #ff4444 !important; color:#ff4444 !important; background:rgba(255,0,0,0.05) !important; } `); // 1. 脱壳逻辑 function getRealUrl(url) { try { const u = new URL(url); if (u.hostname.includes('google.com') && u.searchParams.has('q')) return u.searchParams.get('q'); if (u.hostname.includes('baidu.com') && u.searchParams.has('url')) return u.searchParams.get('url'); } catch (e) {} return url; } // 2. 入境自检 (已更名为 ASCII 兼容名称) function checkIncoming() { const url = window.location.href; if (url.length < 25 || /google|baidu|bing/.test(window.location.hostname)) return; GM_xmlhttpRequest({ method: "POST", url: API_ENDPOINT, data: JSON.stringify({ url }), headers: { "Content-Type": "application/json" }, onload: (res) => { try { const data = JSON.parse(res.responseText); if (data.isRickroll) { window.stop(); renderBlockPage("入境检测拦截", url); } } catch (e) {} } }); } // 3. UI 渲染函数 function renderBlockPage(title, url) { if (document.getElementById('rick-breaker-overlay')) return; document.documentElement.innerHTML = ""; const div = document.createElement('div'); div.id = 'rick-breaker-overlay'; div.innerHTML = `
目标链接经穿透分析确认为 Rickroll。