当前位置:首页 >记录 > 正文内容

chrome和firefox关闭webrtc

5年前 (2021-09-02)记录

Firefox可在浏览器上输入:about:config。之后搜索:media.peerconnection.enabled。找到它后双击,将其改成 false 即可。

chrome在webstory搜索webrtc





原理可以参考一下这里: https://github.com/diafygi/webrtc-ips

或者直接把下面这段代码放在chrome的console里运行一下,就知道自己的真实IP了。

//get the IP addresses associated with an account 
function getIPs(callback){ 
var ip_dups = {};
//compatibility for firefox and chrome 
var RTCPeerConnection = window.RTCPeerConnection 
|| window.mozRTCPeerConnection 
|| window.webkitRTCPeerConnection; 
var mediaConstraints = { 
optional: [{RtpDataChannels: true}] 
};
//firefox already has a default stun server in about:config 
// media.peerconnection.default_iceservers = 
// [{"url": "stun:stun.services.mozilla.com"}] 
var servers = undefined;
//add same stun server for chrome 
if(window.webkitRTCPeerConnection) 
servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};
//construct a new RTCPeerConnection 
var pc = new RTCPeerConnection(servers, mediaConstraints);
//listen for candidate events 
pc.onicecandidate = function(ice){
//skip non-candidate events 
if(ice.candidate){
//match just the IP address 
var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3})/ 
var ip_addr = ip_regex.exec(ice.candidate.candidate)[1];
//remove duplicates 
if(ip_dups[ip_addr] === undefined) 
callback(ip_addr);
ip_dups[ip_addr] = true; 
} 
};
//create a bogus data channel 
pc.createDataChannel("");
//create an offer sdp 
pc.createOffer(function(result){
//trigger the stun server request 
pc.setLocalDescription(result, function(){}, function(){});
}, function(){}); 
}
//Test: Print the IP addresses into the console 
getIPs(function(ip){console.log(ip);});





参考:https://www.cnblogs.com/xuan52rock/p/11249083.html

相关文章

v2rayN 已停止工作问题事件名称:CLR20r3

v2rayN 已停止工作问题事件名称:CLR20r3

如下图我的系统版本  WIN7 X64 中文版到这里下载 https://www.microsoft.com/zh-CN/download/details.aspx?id=4264...

V2Ray安装完成 出现 500 Internal Privoxy Error 错误

V2Ray安装完成 出现 500 Internal Privoxy Error 错误

先尝试看一下能不能使用手机正常使用如果手机不能正常使用,检查各种配置,或者重新安装如果手机能正常使用,win不能,那么检查本地时间是否正确,误差必须在2分钟以内具体的,点右下角日期和时间那里然后点时间...

一个很好用的浏览器指纹检测网站

一个很好用的浏览器指纹检测网站

https://panopticlick.eff.org/...

将Chrome浏览器扩展插件修改为手机版

将Chrome浏览器扩展插件修改为手机版

转载自:https://www.cccitu.com/2666.htmlYandex浏览器:这是目前可知最兼容电脑版Chrome扩展程序的安卓手机版浏览器。要知道,目前连官方安卓版 Chrome浏览器...

下载火狐 Firefox 国际版+完整离线安装包+标准版原版

下载火狐 Firefox 国际版+完整离线安装包+标准版原版

电脑上安装的是 Google Chrome 浏览器,这也是我的主力浏览器。另外,IE 是系统自带的,作为辅助使用。但是 IE 性能实在太差了,难用。打算再安装一个浏览器,...