mirror of https://github.com/gorhill/uBlock.git
Improve same-origin test for CNAME-uncloaking purpose
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1062
Related feedback:
- 161a175bb0 (commitcomment-90926455)
This commit is contained in:
parent
fac6e6e45e
commit
c143ded758
|
@ -256,13 +256,14 @@ vAPI.Net = class extends vAPI.Net {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const isRootDocument = details.type === 'main_frame' &&
|
|
||||||
this.cnameIgnoreRootDocument;
|
|
||||||
const hn = hostnameFromNetworkURL(details.url);
|
const hn = hostnameFromNetworkURL(details.url);
|
||||||
const cnRecord = this.cnames.get(hn);
|
const cnRecord = this.cnames.get(hn);
|
||||||
if ( cnRecord !== undefined ) {
|
if ( cnRecord !== undefined ) {
|
||||||
return this.processCanonicalName(hn, cnRecord, details);
|
return this.processCanonicalName(hn, cnRecord, details);
|
||||||
}
|
}
|
||||||
|
const documentUrl = details.documentUrl || details.url;
|
||||||
|
const isRootDocument = this.cnameIgnoreRootDocument &&
|
||||||
|
hn === hostnameFromNetworkURL(documentUrl);
|
||||||
return browser.dns.resolve(hn, [ 'canonical_name' ]).then(
|
return browser.dns.resolve(hn, [ 'canonical_name' ]).then(
|
||||||
rec => {
|
rec => {
|
||||||
const cnRecord = this.recordCanonicalName(hn, rec, isRootDocument);
|
const cnRecord = this.recordCanonicalName(hn, rec, isRootDocument);
|
||||||
|
|
Loading…
Reference in New Issue