mirror of https://github.com/gorhill/uBlock.git
this fixes #533 (need confirmation)
This commit is contained in:
parent
937218c941
commit
09d7d1fdc4
|
@ -109,6 +109,26 @@ vAPI.browserSettings = {
|
|||
break;
|
||||
|
||||
case 'webrtcIPAddress':
|
||||
// https://github.com/gorhill/uBlock/issues/533#issuecomment-164292868
|
||||
// If WebRTC is supported, there won't be an exception if we
|
||||
// try to instanciate a peer connection object.
|
||||
var pc = null;
|
||||
try {
|
||||
var PC = self.RTCPeerConnection || self.webkitRTCPeerConnection;
|
||||
if ( PC ) {
|
||||
pc = new PC(null);
|
||||
}
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
}
|
||||
if ( pc === null ) {
|
||||
break;
|
||||
}
|
||||
pc.close();
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/533
|
||||
// If we reach this point, the property
|
||||
// `webRTCMultipleRoutesEnabled` can be safely accessed.
|
||||
if ( typeof chrome.privacy.network.webRTCMultipleRoutesEnabled === 'object' ) {
|
||||
try {
|
||||
chrome.privacy.network.webRTCMultipleRoutesEnabled.set({
|
||||
|
|
Loading…
Reference in New Issue