mirror of https://github.com/gorhill/uBlock.git
Further narrow when unconditionally calling webRTCIPHandlingPolicy.clear()
The enabled cached state probably exists in the browser only when the setting was originally enabled -- so we need to clear it only in such case.
This commit is contained in:
parent
19681f510d
commit
a2d83afe66
|
@ -152,7 +152,7 @@ vAPI.browserSettings = (( ) => {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'webrtcIPAddress':
|
||||
case 'webrtcIPAddress': {
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/1928
|
||||
// https://www.reddit.com/r/uBlockOrigin/comments/sl7p74/
|
||||
// Hypothetical: some browsers _think_ uBO is still using
|
||||
|
@ -161,26 +161,27 @@ vAPI.browserSettings = (( ) => {
|
|||
// using the setting appears to solve those unexpected
|
||||
// reported occurrences of uBO interfering despite never
|
||||
// using the API.
|
||||
const mustEnable = !details[setting];
|
||||
if ( this.canLeakLocalIPAddresses === false ) {
|
||||
if ( vAPI.webextFlavor.soup.has('chromium') ) {
|
||||
if ( mustEnable && vAPI.webextFlavor.soup.has('chromium') ) {
|
||||
bp.network.webRTCIPHandlingPolicy.clear({
|
||||
scope: 'regular',
|
||||
});
|
||||
}
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
if ( !!details[setting] ) {
|
||||
bp.network.webRTCIPHandlingPolicy.clear({
|
||||
scope: 'regular',
|
||||
});
|
||||
} else {
|
||||
if ( mustEnable ) {
|
||||
bp.network.webRTCIPHandlingPolicy.set({
|
||||
value: 'default_public_interface_only',
|
||||
scope: 'regular'
|
||||
});
|
||||
} else {
|
||||
bp.network.webRTCIPHandlingPolicy.clear({
|
||||
scope: 'regular',
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue