@
anonymouswll 你这个脚本用这个网站
https://browserleaks.com/webrtc 测还是会泄露 IP ,我让 ChatGPT 写了一个:
```
// ==UserScript==
// @
name Disable WebRTC
// @
namespace http://tampermonkey.net/// @
version 1.0
// @
description Disable WebRTC to improve privacy
// @
author You
// @
match *://*/*
// @
grant none
// @
run-at document-start
// ==/UserScript==
(function() {
'use strict';
// Disable RTCPeerConnection to prevent WebRTC leaks
window.RTCPeerConnection = function() {
return null;
};
window.webkitRTCPeerConnection = function() {
return null;
};
// Other WebRTC related components that could be disabled
// Not all of these may be present or necessary to disable depending on the browser
window.RTCSessionDescription = function() {
return null;
};
window.RTCIceCandidate = function() {
return null;
};
// Disable navigator.mediaDevices.getUserMedia to prevent camera and microphone access
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia = function() {
return Promise.reject(new Error("UserMedia is disabled for privacy reasons"));
};
}
})();
```