From 832ebd360e52086badc29f8fe160b8b047ccf2f1 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 8 Dec 2019 11:08:04 -0500 Subject: [PATCH] Mind that Firefox 59 and less does not support `browser.dns` --- platform/firefox/vapi-webrequest.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/firefox/vapi-webrequest.js b/platform/firefox/vapi-webrequest.js index d077da1bd..8b182f883 100644 --- a/platform/firefox/vapi-webrequest.js +++ b/platform/firefox/vapi-webrequest.js @@ -68,11 +68,12 @@ this.cnameMaxTTL = 60; this.cnameReplayFullURL = false; this.cnameTimer = undefined; - this.cnameUncloak = true; + this.cnameUncloak = browser.dns instanceof Object; } setOptions(options) { super.setOptions(options); - this.cnameUncloak = options.cnameUncloak !== false; + this.cnameUncloak = browser.dns instanceof Object && + options.cnameUncloak !== false; this.cnameIgnoreList = this.regexFromStrList(options.cnameIgnoreList); this.cnameIgnore1stParty = options.cnameIgnore1stParty !== false; this.cnameIgnoreExceptions = options.cnameIgnoreExceptions !== false; @@ -202,6 +203,7 @@ } onBeforeSuspendableRequest(details) { const r = super.onBeforeSuspendableRequest(details); + if ( this.cnameUncloak === false ) { return r; } if ( r !== undefined ) { if ( r.cancel === true || @@ -217,7 +219,6 @@ ) { return; } - if ( this.cnameUncloak === false ) { return; } const hn = vAPI.hostnameFromNetworkURL(details.url); const cname = this.cnames.get(hn); if ( cname === '' ) { return; }