虎牙屏蔽 PCDN (WebRTC打洞)

2025年中开始发现虎牙网页版会偷跑上传, 这能忍? 必须屏蔽!

当前为 2025-09-14 提交的版本,查看 最新版本

// ==UserScript==
// @name         虎牙屏蔽 PCDN (WebRTC打洞)
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  2025年中开始发现虎牙网页版会偷跑上传, 这能忍? 必须屏蔽!
// @author       浩劫者12345
// @match        https://*.huya.com/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    if (window.RTCPeerConnection) {
        const log = console.log
        const origRTCPeerConnection = window.RTCPeerConnection

        class HookedRTCPeerConnection {
            constructor(c) {
                log('Blocking WebRTC connection:', JSON.stringify(c))
                throw new Error('WebRTC is disabled by userscript')
                // return new origRTCPeerConnection(c)
            }
        }

        window.RTCPeerConnection = HookedRTCPeerConnection
        window.webkitRTCPeerConnection = window.RTCPeerConnection
        window.mozRTCPeerConnection = window.RTCPeerConnection
    }
})();

QingJ © 2025

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