mirror of https://github.com/gorhill/uBlock.git
Fix handling of cname-aliased URLs in click-to-load widget
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1455
This commit is contained in:
parent
bac7873edd
commit
40c145d76a
|
@ -31,13 +31,16 @@
|
||||||
if ( typeof vAPI !== 'object' ) { return; }
|
if ( typeof vAPI !== 'object' ) { return; }
|
||||||
|
|
||||||
const url = new URL(self.location.href);
|
const url = new URL(self.location.href);
|
||||||
const frameURL = url.searchParams.get('url');
|
const actualURL = url.searchParams.get('url');
|
||||||
|
const frameURL = url.searchParams.get('aliasURL') || actualURL;
|
||||||
const frameURLElem = document.getElementById('frameURL');
|
const frameURLElem = document.getElementById('frameURL');
|
||||||
|
|
||||||
frameURLElem.children[0].textContent = frameURL;
|
frameURLElem.children[0].textContent = actualURL;
|
||||||
frameURLElem.children[1].href = frameURL;
|
|
||||||
|
|
||||||
document.body.setAttribute('title', frameURL);
|
frameURLElem.children[1].href = frameURL;
|
||||||
|
frameURLElem.children[1].title = frameURL;
|
||||||
|
|
||||||
|
document.body.setAttribute('title', actualURL);
|
||||||
|
|
||||||
const onWindowResize = function() {
|
const onWindowResize = function() {
|
||||||
document.body.style.width = `${self.innerWidth}px`;
|
document.body.style.width = `${self.innerWidth}px`;
|
||||||
|
|
|
@ -596,7 +596,9 @@ const PageStore = class {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cacheableResult = this.cacheableResults.has(fctxt.itype);
|
const cacheableResult =
|
||||||
|
this.cacheableResults.has(fctxt.itype) &&
|
||||||
|
fctxt.aliasURL === undefined;
|
||||||
|
|
||||||
if ( cacheableResult ) {
|
if ( cacheableResult ) {
|
||||||
const entry = this.netFilteringCache.lookupResult(fctxt);
|
const entry = this.netFilteringCache.lookupResult(fctxt);
|
||||||
|
|
|
@ -69,7 +69,7 @@ const redirectableResources = new Map([
|
||||||
alias: 'static.chartbeat.com/chartbeat.js',
|
alias: 'static.chartbeat.com/chartbeat.js',
|
||||||
} ],
|
} ],
|
||||||
[ 'click2load.html', {
|
[ 'click2load.html', {
|
||||||
params: [ 'url' ],
|
params: [ 'aliasURL', 'url' ],
|
||||||
} ],
|
} ],
|
||||||
[ 'doubleclick_instream_ad_status.js', {
|
[ 'doubleclick_instream_ad_status.js', {
|
||||||
alias: 'doubleclick.net/instream/ad_status.js',
|
alias: 'doubleclick.net/instream/ad_status.js',
|
||||||
|
|
Loading…
Reference in New Issue