From 3059db77c4a4e8a9a44931b0aa1989c272b07dc4 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 14 Oct 2020 13:37:09 -0400 Subject: [PATCH] Use proxy detection code path only on Firefox 79 and less Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/911 This was fixed in Firefox 80: - https://bugzilla.mozilla.org/show_bug.cgi?id=1618271 --- platform/firefox/vapi-webrequest.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/platform/firefox/vapi-webrequest.js b/platform/firefox/vapi-webrequest.js index a7c14c24c..eaa74b34f 100644 --- a/platform/firefox/vapi-webrequest.js +++ b/platform/firefox/vapi-webrequest.js @@ -125,19 +125,21 @@ this.cnameFlushTime = Date.now() + this.cnameMaxTTL * 60000; // https://github.com/uBlockOrigin/uBlock-issues/issues/911 // Install/remove proxy detector. - const wrohr = browser.webRequest.onHeadersReceived; - if ( cnameUncloak === false || cnameUncloakProxied ) { - if ( wrohr.hasListener(proxyDetector) ) { - wrohr.removeListener(proxyDetector); + if ( vAPI.webextFlavor.major < 80 ) { + const wrohr = browser.webRequest.onHeadersReceived; + if ( cnameUncloak === false || cnameUncloakProxied ) { + if ( wrohr.hasListener(proxyDetector) ) { + wrohr.removeListener(proxyDetector); + } + } else if ( wrohr.hasListener(proxyDetector) === false ) { + wrohr.addListener( + proxyDetector, + { urls: [ '*://*/*' ] }, + [ 'blocking' ] + ); } - } else if ( wrohr.hasListener(proxyDetector) === false ) { - wrohr.addListener( - proxyDetector, - { urls: [ '*://*/*' ] }, - [ 'blocking' ] - ); + proxyDetectorTryCount = 32; } - proxyDetectorTryCount = 32; } normalizeDetails(details) { if ( mustPunycode && !reAsciiHostname.test(details.url) ) {