mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
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;
|
break;
|
||||||
|
|
||||||
case 'webrtcIPAddress':
|
case 'webrtcIPAddress': {
|
||||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/1928
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/1928
|
||||||
// https://www.reddit.com/r/uBlockOrigin/comments/sl7p74/
|
// https://www.reddit.com/r/uBlockOrigin/comments/sl7p74/
|
||||||
// Hypothetical: some browsers _think_ uBO is still using
|
// Hypothetical: some browsers _think_ uBO is still using
|
||||||
@ -161,26 +161,27 @@ vAPI.browserSettings = (( ) => {
|
|||||||
// using the setting appears to solve those unexpected
|
// using the setting appears to solve those unexpected
|
||||||
// reported occurrences of uBO interfering despite never
|
// reported occurrences of uBO interfering despite never
|
||||||
// using the API.
|
// using the API.
|
||||||
|
const mustEnable = !details[setting];
|
||||||
if ( this.canLeakLocalIPAddresses === false ) {
|
if ( this.canLeakLocalIPAddresses === false ) {
|
||||||
if ( vAPI.webextFlavor.soup.has('chromium') ) {
|
if ( mustEnable && vAPI.webextFlavor.soup.has('chromium') ) {
|
||||||
bp.network.webRTCIPHandlingPolicy.clear({
|
bp.network.webRTCIPHandlingPolicy.clear({
|
||||||
scope: 'regular',
|
scope: 'regular',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
if ( !!details[setting] ) {
|
if ( mustEnable ) {
|
||||||
bp.network.webRTCIPHandlingPolicy.clear({
|
|
||||||
scope: 'regular',
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
bp.network.webRTCIPHandlingPolicy.set({
|
bp.network.webRTCIPHandlingPolicy.set({
|
||||||
value: 'default_public_interface_only',
|
value: 'default_public_interface_only',
|
||||||
scope: 'regular'
|
scope: 'regular'
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
bp.network.webRTCIPHandlingPolicy.clear({
|
||||||
|
scope: 'regular',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user