this fixes #533 (need confirmation)

This commit is contained in:
gorhill 2015-12-13 15:38:31 -05:00
parent 937218c941
commit 09d7d1fdc4
1 changed files with 20 additions and 0 deletions

View File

@ -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({