Skip to content

Instantly share code, notes, and snippets.

@love4taylor
Created February 24, 2024 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save love4taylor/0d3bb4a308d7398a3dc33543e18b59b2 to your computer and use it in GitHub Desktop.
Save love4taylor/0d3bb4a308d7398a3dc33543e18b59b2 to your computer and use it in GitHub Desktop.
// ==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