Use disable_non_proxied_udp for webRTCIPHandlingPolicy

The stricter mode `disable_non_proxied_udp` is preferable
to `default_public_interface_only` to prevent local IP
address leakage through WebRTC.

This mode is properly supported since Firefox 70, so the
less strict `default_public_interface_only` will now be
used only for Firefox 69 and older.
This commit is contained in:
Raymond Hill 2020-02-28 14:30:40 -05:00
parent be111c4036
commit a1dabf3c1a
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -181,12 +181,14 @@ vAPI.browserSettings = (( ) => {
// https://github.com/gorhill/uBlock/issues/3009
// Firefox currently works differently, use
// `default_public_interface_only` for now.
bpn.webRTCIPHandlingPolicy.set({
value: vAPI.webextFlavor.soup.has('chromium')
? 'disable_non_proxied_udp'
: 'default_public_interface_only',
scope: 'regular',
});
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/privacy/network#Browser_compatibility
// Firefox 70+ supports `disable_non_proxied_udp`
const value =
vAPI.webextFlavor.soup.has('firefox') &&
vAPI.webextFlavor.major < 70
? 'default_public_interface_only'
: 'disable_non_proxied_udp';
bpn.webRTCIPHandlingPolicy.set({ value, scope: 'regular' });
}
},