// ==UserScript== // @name X修复器 - 智能网站修复 // @namespace https://x.aixgn.cn/ // @version 1.0.0 // @description 一键诊断并修复网站问题,支持CSS/JS/SEO/安全/性能修复 // @author 新概念AI · 智位小猿 // @match *://*/* // @grant GM_xmlhttpRequest // @grant GM_addStyle // @connect x.aixgn.cn // ==/UserScript== (function() { 'use strict'; // 添加悬浮按钮 const btn = document.createElement('div'); btn.innerHTML = '🛠️ 诊断'; btn.style.cssText = 'position:fixed;bottom:80px;right:20px;z-index:999999;background:linear-gradient(135deg,#059669,#10b981);color:#fff;padding:10px 18px;border-radius:25px;cursor:pointer;font-size:13px;font-weight:bold;box-shadow:0 4px 15px rgba(5,150,105,.4);font-family:Arial;'; document.body.appendChild(btn); // 添加结果面板 const panel = document.createElement('div'); panel.style.cssText = 'position:fixed;bottom:130px;right:20px;z-index:999999;width:320px;background:#fff;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.2);padding:16px;display:none;font-family:Arial;font-size:13px;max-height:400px;overflow-y:auto;'; document.body.appendChild(panel); btn.onclick = function() { if (panel.style.display === 'none') { panel.style.display = 'block'; panel.innerHTML = '
扫描中...
'; scanSite(); } else { panel.style.display = 'none'; } }; function scanSite() { const url = location.href; GM_xmlhttpRequest({ method: 'POST', url: 'https://x.aixgn.cn/xrepair/scan', headers: {'Content-Type': 'application/json'}, data: JSON.stringify({url: url}), onload: function(res) { try { const data = JSON.parse(res.responseText); const issues = data.issues || []; let html = '
发现 ' + issues.length + ' 个问题
'; issues.slice(0, 8).forEach(function(i) { const color = i.severity === 'high' ? '#ef4444' : i.severity === 'medium' ? '#f59e0b' : '#10b981'; html += '
[' + i.severity + '] ' + i.type + '
'; }); html += '一键修复 ¥3.9起'; panel.innerHTML = html; } catch(e) { panel.innerHTML = '
扫描失败
'; } }, onerror: function() { panel.innerHTML = '
网络错误
'; } }); } })();