Created
February 24, 2024 11:37
-
-
Save love4taylor/0d3bb4a308d7398a3dc33543e18b59b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 干掉B站直播P2P传输 | |
// @namespace https://bbs.nga.cn/read.php?&tid=25285579&pid=490022087&to=1 | |
// @version 0.1 | |
// @description 每60秒清理一次P2P相关函数 | |
// @author xfgryujk | |
// @include /https?:\/\/live\.bilibili\.com\/?\??.*/ | |
// @include /https?:\/\/live\.bilibili\.com\/\d+\??.*/ | |
// @include /https?:\/\/live\.bilibili\.com\/(blanc\/)?\d+\??.*/ | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
const clear = () => { | |
console.log("clear functions!"); | |
if (window.RTCPeerConnection) delete window.RTCPeerConnection; | |
if (window.mozRTCPeerConnection) delete window.mozRTCPeerConnection; | |
if (window.webkitRTCPeerConnection) delete window.webkitRTCPeerConnection; | |
if (window.RTCDataChannel) delete window.RTCDataChannel; | |
if (window.DataChannel) delete window.DataChannel; | |
}; | |
clear(); | |
(function() { | |
var interval = 60; // 间隔时间,秒 | |
var hdl = setInterval(clear, interval * 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment