From 00b257caa7ded641903997c49ecc4d97b4f10b74 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 5 Feb 2022 12:04:08 -0500 Subject: [PATCH] Unconditionally call webRTCIPHandlingPolicy.clear() at launch On Chromium-based browsers only. Related issue/feedback: - https://github.com/uBlockOrigin/uBlock-issues/issues/1928 - https://www.reddit.com/r/uBlockOrigin/comments/sl7p74/ --- platform/common/vapi-background.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/platform/common/vapi-background.js b/platform/common/vapi-background.js index ce7c90ed1..cd00a322e 100644 --- a/platform/common/vapi-background.js +++ b/platform/common/vapi-background.js @@ -153,7 +153,22 @@ vAPI.browserSettings = (( ) => { break; case 'webrtcIPAddress': - if ( this.canLeakLocalIPAddresses === false ) { return; } + // https://github.com/uBlockOrigin/uBlock-issues/issues/1928 + // https://www.reddit.com/r/uBlockOrigin/comments/sl7p74/ + // Hypothetical: some browsers _think_ uBO is still using + // the setting possibly based on cached state from the + // past, and making an explicit API call that uBO is not + // using the setting appears to solve those unexpected + // reported occurrences of uBO interfering despite never + // using the API. + if ( this.canLeakLocalIPAddresses === false ) { + if ( vAPI.webextFlavor.soup.has('chromium') ) { + bp.network.webRTCIPHandlingPolicy.clear({ + scope: 'regular', + }); + } + return; + } if ( !!details[setting] ) { bp.network.webRTCIPHandlingPolicy.clear({ scope: 'regular',