// ==UserScript== // @name 阻止视频网站利用WebRTC进行PCDN分发 // @version 1.3 // @description 阻止视频网站通过WebRTC将用户作为PCDN节点,并在尝试连接时弹出红色警告 // @author 嘉友友 // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48cGF0aCBmaWxsPSIjZGMxNDJjIiBkPSJNNTAgNSBDOTAgMjAgOTAgNDUgOTAgNDUgQzkwIDcwIDUwIDk1IDUwIDk1IEM1MCA5NSAxMCA3MCAxMCA0NSBDMTAgNDUgMTAgMjAgNTAgNSBaIi8+PHJlY3QgeD0iNDciIHk9IjMwIiB3aWR0aD0iNiIgaGVpZ2h0PSIyNSIgZmlsbD0iI2ZmZiIgcng9IjEiLz48Y2lyY2xlIGN4PSI1MCIgY3k9IjY4IiByPSI0IiBmaWxsPSIjZmZmIi8+PC9zdmc+ // @match *://*.iqiyi.com/* // @match *://*.v.qq.com/* // @match *://*.youku.com/* // @match *://*.bilibili.com/* // @match *://*.mgtv.com/* // @match *://*.tv.sohu.com/* // @match *://*.le.com/* // @match *://*.tudou.com/* // @match *://*.acfun.cn/* // @match *://*.migu.cn/* // @match *://*.cctv.com/* // @match *://*.cntv.cn/* // @match *://*.douyin.com/* // @match *://*.ixigua.com/* // @match *://*.ppxcloud.com/* // @match *://*.boosoo.com/* // @match *://*.fun.tv/* // @match *://*.pptv.com/* // @match *://*.wasu.cn/* // @match *://*.baomitt.com/* // @match *://*.netflix.com/* // @match *://*.youtube.com/* // @grant none // @run-at document-start // @license GPL-3.0 // @namespace https://greasyfork.org/users/1336389 // @downloadURL none // ==/UserScript== (function() { 'use strict'; // --- 配置 --- const MAX_WARNINGS = 3; // 允许弹出的最大次数 let warningCount = 0; // 当前已弹出次数计数器 // --- 定义警告通知函数 --- function showBlockNotification() { // 防止重复弹出 if (document.getElementById('webrtc-block-warning')) return; // 检查 body 是否存在 if (!document.body) { return setTimeout(showBlockNotification, 100); } const div = document.createElement('div'); div.id = 'webrtc-block-warning'; // 样式:居中显示,红色醒目 div.style.position = 'fixed'; div.style.top = '50%'; div.style.left = '50%'; div.style.transform = 'translate(-50%, -50%)'; div.style.zIndex = '2147483647'; div.style.padding = '20px 30px'; div.style.background = 'rgba(220, 20, 60, 0.95)'; div.style.color = 'white'; div.style.fontFamily = 'Microsoft YaHei, Arial, sans-serif'; div.style.fontSize = '16px'; div.style.borderRadius = '8px'; div.style.boxShadow = '0 4px 20px rgba(0,0,0,0.6)'; div.style.cursor = 'pointer'; div.style.textAlign = 'center'; div.style.maxWidth = '80%'; div.style.wordBreak = 'break-all'; div.innerHTML = `