mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
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
1 changed files with 3 additions and 2 deletions
|
@ -256,13 +256,14 @@ vAPI.Net = class extends vAPI.Net {
|
|||
return r;
|
||||
}
|
||||
}
|
||||
const isRootDocument = details.type === 'main_frame' &&
|
||||
this.cnameIgnoreRootDocument;
|
||||
const hn = hostnameFromNetworkURL(details.url);
|
||||
const cnRecord = this.cnames.get(hn);
|
||||
if ( cnRecord !== undefined ) {
|
||||
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(
|
||||
rec => {
|
||||
const cnRecord = this.recordCanonicalName(hn, rec, isRootDocument);
|
||||
|
|
Loading…
Reference in a new issue