mirror of https://github.com/gorhill/uBlock.git
Clear internal cache when loading redirect rules
Related commit:
- 3e5c9e00ab
This fix a regression: newly added redirect rules
could end up not being taken into account unless
uBO was restarted.
This commit is contained in:
parent
4a60810389
commit
e0b8cf24d1
|
@ -266,13 +266,6 @@ const RedirectEngine = function() {
|
||||||
this.resources = new Map();
|
this.resources = new Map();
|
||||||
this.reset();
|
this.reset();
|
||||||
this.resourceNameRegister = '';
|
this.resourceNameRegister = '';
|
||||||
|
|
||||||
// Internal use
|
|
||||||
this._missedQueryHash = '';
|
|
||||||
this._src = '';
|
|
||||||
this._srcAll = [ '*' ];
|
|
||||||
this._des = '';
|
|
||||||
this._desAll = [ '*' ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -281,9 +274,18 @@ RedirectEngine.prototype.reset = function() {
|
||||||
this.rules = new Map();
|
this.rules = new Map();
|
||||||
this.ruleSources = new Set();
|
this.ruleSources = new Set();
|
||||||
this.ruleDestinations = new Set();
|
this.ruleDestinations = new Set();
|
||||||
|
this.resetCache();
|
||||||
this.modifyTime = Date.now();
|
this.modifyTime = Date.now();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
RedirectEngine.prototype.resetCache = function() {
|
||||||
|
this._missedQueryHash = '';
|
||||||
|
this._src = '';
|
||||||
|
this._srcAll = [ '*' ];
|
||||||
|
this._des = '';
|
||||||
|
this._desAll = [ '*' ];
|
||||||
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
RedirectEngine.prototype.freeze = function() {
|
RedirectEngine.prototype.freeze = function() {
|
||||||
|
@ -594,6 +596,7 @@ RedirectEngine.prototype.fromSelfie = function(path) {
|
||||||
this.rules = new Map(selfie.rules);
|
this.rules = new Map(selfie.rules);
|
||||||
this.ruleSources = new Set(selfie.ruleSources);
|
this.ruleSources = new Set(selfie.ruleSources);
|
||||||
this.ruleDestinations = new Set(selfie.ruleDestinations);
|
this.ruleDestinations = new Set(selfie.ruleDestinations);
|
||||||
|
this.resetCache();
|
||||||
this.modifyTime = Date.now();
|
this.modifyTime = Date.now();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue