ability to prevent local ip address leak thru webrtc

This commit is contained in:
gorhill 2015-06-24 20:01:27 -04:00
parent c596e6c0e1
commit 1ba7894a29
8 changed files with 37 additions and 2 deletions

View file

@ -85,6 +85,15 @@ vAPI.browserSettings = {
});
break;
case 'webrtcIPAddress':
if ( typeof chrome.privacy.network.webRTCMultipleRoutesEnabled === 'object' ) {
chrome.privacy.network.webRTCMultipleRoutesEnabled.set({
value: !!details[setting],
scope: 'regular'
});
}
break;
default:
break;
}

View file

@ -195,6 +195,16 @@ vAPI.browserSettings = {
}
break;
case 'webrtcIPAddress':
this.rememberOriginalValue('media.peerconnection', 'enabled');
value = !!details[setting];
if ( value === true ) {
this.clear('media.peerconnection', 'enabled');
} else {
this.setBool('media.peerconnection', 'enabled', false);
}
break;
default:
break;
}

View file

@ -183,6 +183,10 @@
"message":"Disable hyperlink auditing/beacon",
"description":"English: "
},
"settingsWebRTCIPAddressHiddenPrompt":{
"message":"Prevent WebRTC from leaking local IP address",
"description":"English: "
},
"settingsExperimentalPrompt":{
"message":"Enable experimental features (<a href='https:\/\/github.com\/gorhill\/uBlock\/wiki\/Experimental-features'>About<\/a>)",
"description":"English: Enable experimental features"

View file

@ -65,7 +65,8 @@ return {
parseAllABPHideFilters: true,
prefetchingDisabled: true,
requestLogMaxEntries: 1000,
showIconBadge: true
showIconBadge: true,
webrtcIPAddressHidden: false
},
// https://github.com/chrisaljoudi/uBlock/issues/180

View file

@ -204,6 +204,12 @@ var onUserSettingsReceived = function(details) {
changeUserSettings('hyperlinkAuditingDisabled', this.checked);
});
uDom('#webrtc-ipaddress-hidden')
.prop('checked', details.webrtcIPAddressHidden === true)
.on('change', function(){
changeUserSettings('webrtcIPAddressHidden', this.checked);
});
uDom('#experimental-enabled')
.prop('checked', details.experimentalEnabled === true)
.on('change', function(){

View file

@ -159,7 +159,8 @@ var onUserSettingsReady = function(fetched) {
µb.contextMenu.toggle(userSettings.contextMenuEnabled);
vAPI.browserSettings.set({
'hyperlinkAuditing': !userSettings.hyperlinkAuditingDisabled,
'prefetching': !userSettings.prefetchingDisabled
'prefetching': !userSettings.prefetchingDisabled,
'webrtcIPAddress': !userSettings.webrtcIPAddressHidden
});
µb.permanentFirewall.fromString(fetched.dynamicFilteringString);

View file

@ -279,6 +279,9 @@ var matchWhitelistDirective = function(url, hostname, directive) {
case 'prefetchingDisabled':
vAPI.browserSettings.set({ 'prefetching': !value });
break;
case 'webrtcIPAddressHidden':
vAPI.browserSettings.set({ 'webrtcIPAddress': !value });
break;
default:
break;
}

View file

@ -19,6 +19,7 @@
<li class="subgroup"><span data-i18n="3pGroupPrivacy"></span><ul>
<li><input id="prefetching-disabled" type="checkbox"><label data-i18n="settingsPrefetchingDisabledPrompt" for="prefetching-disabled"></label> <a class="fa info" href="https://wikipedia.org/wiki/Link_prefetching#Issues_and_criticisms" target="_blank">&#xf05a;</a>
<li><input id="hyperlink-auditing-disabled" type="checkbox"><label data-i18n="settingsHyperlinkAuditingDisabledPrompt" for="hyperlink-auditing-disabled"></label> <a class="fa info" href="http://www.wilderssecurity.com/threads/hyperlink-auditing-aka-a-ping-and-beacon-aka-navigator-sendbeacon.364904/" target="_blank">&#xf05a;</a>
<li><input id="webrtc-ipaddress-hidden" type="checkbox"><label data-i18n="settingsWebRTCIPAddressHiddenPrompt" for="webrtc-ipaddress-hidden"></label>
</ul>
</ul>