1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 01:27:12 +02:00
This commit is contained in:
Raymond Hill 2019-09-07 08:31:32 -04:00
parent a488e1f053
commit 3eeaba45d9
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -279,7 +279,6 @@ RedirectEngine.prototype.reset = function() {
};
RedirectEngine.prototype.resetCache = function() {
this._missedQueryHash = '';
this._src = '';
this._srcAll = [ '*' ];
this._des = '';
@ -321,26 +320,16 @@ RedirectEngine.prototype.lookup = function(fctxt) {
const src = fctxt.getDocHostname();
const des = fctxt.getHostname();
const type = fctxt.type;
const queryHash = `${src} ${des} ${type}`;
if ( queryHash === this._missedQueryHash ) {
return;
}
if ( src !== this._src ) {
this._src = src;
this.decomposeHostname(src, this.ruleSources, this._srcAll);
}
if ( this._srcAll.length === 0 ) {
this._missedQueryHash = queryHash;
return;
}
if ( this._srcAll.length === 0 ) { return; }
if ( des !== this._des ) {
this._des = des;
this.decomposeHostname(des, this.ruleDestinations, this._desAll);
}
if ( this._desAll.length === 0 ) {
this._missedQueryHash = queryHash;
return;
}
if ( this._desAll.length === 0 ) { return; }
const reqURL = fctxt.url;
for ( const src of this._srcAll ) {
for ( const des of this._desAll ) {
@ -356,7 +345,6 @@ RedirectEngine.prototype.lookup = function(fctxt) {
}
}
}
this._missedQueryHash = queryHash;
};
RedirectEngine.prototype.lookupRule = function(entries, reqURL) {