mirror of https://github.com/gorhill/uBlock.git
Mind that Firefox 59 and less does not support `browser.dns`
This commit is contained in:
parent
1364e4836e
commit
832ebd360e
|
@ -68,11 +68,12 @@
|
||||||
this.cnameMaxTTL = 60;
|
this.cnameMaxTTL = 60;
|
||||||
this.cnameReplayFullURL = false;
|
this.cnameReplayFullURL = false;
|
||||||
this.cnameTimer = undefined;
|
this.cnameTimer = undefined;
|
||||||
this.cnameUncloak = true;
|
this.cnameUncloak = browser.dns instanceof Object;
|
||||||
}
|
}
|
||||||
setOptions(options) {
|
setOptions(options) {
|
||||||
super.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.cnameIgnoreList = this.regexFromStrList(options.cnameIgnoreList);
|
||||||
this.cnameIgnore1stParty = options.cnameIgnore1stParty !== false;
|
this.cnameIgnore1stParty = options.cnameIgnore1stParty !== false;
|
||||||
this.cnameIgnoreExceptions = options.cnameIgnoreExceptions !== false;
|
this.cnameIgnoreExceptions = options.cnameIgnoreExceptions !== false;
|
||||||
|
@ -202,6 +203,7 @@
|
||||||
}
|
}
|
||||||
onBeforeSuspendableRequest(details) {
|
onBeforeSuspendableRequest(details) {
|
||||||
const r = super.onBeforeSuspendableRequest(details);
|
const r = super.onBeforeSuspendableRequest(details);
|
||||||
|
if ( this.cnameUncloak === false ) { return r; }
|
||||||
if ( r !== undefined ) {
|
if ( r !== undefined ) {
|
||||||
if (
|
if (
|
||||||
r.cancel === true ||
|
r.cancel === true ||
|
||||||
|
@ -217,7 +219,6 @@
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( this.cnameUncloak === false ) { return; }
|
|
||||||
const hn = vAPI.hostnameFromNetworkURL(details.url);
|
const hn = vAPI.hostnameFromNetworkURL(details.url);
|
||||||
const cname = this.cnames.get(hn);
|
const cname = this.cnames.get(hn);
|
||||||
if ( cname === '' ) { return; }
|
if ( cname === '' ) { return; }
|
||||||
|
|
Loading…
Reference in New Issue