mirror of https://github.com/gorhill/uBlock.git
Add advanced setting `dnsResolveEnabled`
Default to `true`. Set to `false` to wholly disable calls to `dns.resolve()` (Firefox- only). Disabling calls to `dns.resolve()` will prevent cname-uncloaking and will limit ability to enforce `ipaddress` filter option.
This commit is contained in:
parent
b01a418073
commit
760b2ffce6
|
@ -62,6 +62,7 @@ vAPI.Net = class extends vAPI.Net {
|
||||||
this.cnameIgnoreExceptions = true;
|
this.cnameIgnoreExceptions = true;
|
||||||
this.cnameIgnoreRootDocument = true;
|
this.cnameIgnoreRootDocument = true;
|
||||||
this.cnameReplayFullURL = false;
|
this.cnameReplayFullURL = false;
|
||||||
|
this.dnsResolveEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
setOptions(options) {
|
setOptions(options) {
|
||||||
|
@ -89,6 +90,9 @@ vAPI.Net = class extends vAPI.Net {
|
||||||
if ( 'cnameReplayFullURL' in options ) {
|
if ( 'cnameReplayFullURL' in options ) {
|
||||||
this.cnameReplayFullURL = options.cnameReplayFullURL === true;
|
this.cnameReplayFullURL = options.cnameReplayFullURL === true;
|
||||||
}
|
}
|
||||||
|
if ( 'dnsResolveEnabled' in options ) {
|
||||||
|
this.dnsResolveEnabled = options.dnsResolveEnabled === true;
|
||||||
|
}
|
||||||
this.dnsList.fill(null);
|
this.dnsList.fill(null);
|
||||||
this.dnsDict.clear();
|
this.dnsDict.clear();
|
||||||
}
|
}
|
||||||
|
@ -256,6 +260,7 @@ vAPI.Net = class extends vAPI.Net {
|
||||||
}
|
}
|
||||||
|
|
||||||
dnsShouldResolve(hn) {
|
dnsShouldResolve(hn) {
|
||||||
|
if ( this.dnsResolveEnabled === false ) { return false; }
|
||||||
if ( hn === '' ) { return false; }
|
if ( hn === '' ) { return false; }
|
||||||
const c0 = hn.charCodeAt(0);
|
const c0 = hn.charCodeAt(0);
|
||||||
if ( c0 === 0x5B /* [ */ ) { return false; }
|
if ( c0 === 0x5B /* [ */ ) { return false; }
|
||||||
|
|
|
@ -66,6 +66,7 @@ const hiddenSettingsDefault = {
|
||||||
debugScriptletInjector: false,
|
debugScriptletInjector: false,
|
||||||
differentialUpdate: true,
|
differentialUpdate: true,
|
||||||
disableWebAssembly: false,
|
disableWebAssembly: false,
|
||||||
|
dnsResolveEnabled: true,
|
||||||
extensionUpdateForceReload: false,
|
extensionUpdateForceReload: false,
|
||||||
filterAuthorMode: false,
|
filterAuthorMode: false,
|
||||||
loggerPopupType: 'popup',
|
loggerPopupType: 'popup',
|
||||||
|
|
|
@ -319,6 +319,7 @@ onBroadcast(msg => {
|
||||||
cnameIgnoreRootDocument: µbhs.cnameIgnoreRootDocument,
|
cnameIgnoreRootDocument: µbhs.cnameIgnoreRootDocument,
|
||||||
cnameMaxTTL: µbhs.cnameMaxTTL,
|
cnameMaxTTL: µbhs.cnameMaxTTL,
|
||||||
cnameReplayFullURL: µbhs.cnameReplayFullURL,
|
cnameReplayFullURL: µbhs.cnameReplayFullURL,
|
||||||
|
dnsResolveEnabled: µbhs.dnsResolveEnabled,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue