Skip to content

Commit

Permalink
Use proxy detection code path only on Firefox 79 and less
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Oct 14, 2020
1 parent c227b8b commit 3059db7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions platform/firefox/vapi-webrequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) ) {
Expand Down

0 comments on commit 3059db7

Please sign in to comment.