// ==UserScript== // @name 交叉口流量增强工具 // @namespace http://tampermonkey.net/ // @version 1.0.0 // @description IsVip=1, Canvas"试用"隐藏, 删除激活弹窗 // @author xiansi // @match https://www.roadgee.com/* // @run-at document-start // @grant none // @license GPL // ==/UserScript== (function () { 'use strict'; // ================================================================ // 1. VIP 解锁 // ================================================================ Object.defineProperty(window, 'IsVip', { get: function () { return 1; }, set: function () {}, configurable: false, enumerable: true }); // ================================================================ // 2. Canvas "试用" 水印隐藏 // ================================================================ function sanitize(text) { if (typeof text === 'string' && /试用/.test(text)) { return text.replace(/./g, ' '); } return text; } function patchCtx(proto) { if (!proto) return; var _ft = proto.fillText; var _st = proto.strokeText; var _mt = proto.measureText; proto.fillText = function (text, x, y, maxW) { text = sanitize(text); return maxW !== undefined ? _ft.call(this, text, x, y, maxW) : _ft.call(this, text, x, y); }; proto.strokeText = function (text, x, y, maxW) { text = sanitize(text); return maxW !== undefined ? _st.call(this, text, x, y, maxW) : _st.call(this, text, x, y); }; proto.measureText = function (text) { return _mt.call(this, sanitize(text)); }; } patchCtx(CanvasRenderingContext2D.prototype); if (typeof OffscreenCanvasRenderingContext2D !== 'undefined') { patchCtx(OffscreenCanvasRenderingContext2D.prototype); } // ================================================================ // 3. 删除激活弹窗 #activeCodeBox // ================================================================ document.addEventListener('DOMContentLoaded', function () { var el = document.getElementById('activeCodeBox'); if (el) el.remove(); console.log('[roadgee增强] IsVip =', window.IsVip); }); // 如果被 JS 动态重新插入,再次删除 new MutationObserver(function (mutations) { for (var i = 0; i < mutations.length; i++) { var nodes = mutations[i].addedNodes; for (var j = 0; j < nodes.length; j++) { var n = nodes[j]; if (n.nodeType !== 1) continue; if (n.id === 'activeCodeBox') { n.remove(); continue; } if (n.querySelector && n.querySelector('#activeCodeBox')) { var found = n.querySelector('#activeCodeBox'); if (found) found.remove(); } } } }).observe(document.documentElement, { childList: true, subtree: true }); console.log('[roadgee增强] 已启动 v1.0.0'); })();