mirror of https://github.com/gorhill/uBlock.git
Minor code review
This commit is contained in:
parent
e3247cb48c
commit
581c2824d0
|
@ -19,26 +19,23 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* globals browser */
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
import µb from './background.js';
|
|
||||||
import logger from './logger.js';
|
|
||||||
import { onBroadcast } from './broadcast.js';
|
|
||||||
import { redirectEngine as reng } from './redirect-engine.js';
|
|
||||||
import { sessionFirewall } from './filtering-engines.js';
|
|
||||||
import { MRUCache } from './mrucache.js';
|
|
||||||
import { ScriptletFilteringEngine } from './scriptlet-filtering-core.js';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
domainFromHostname,
|
domainFromHostname,
|
||||||
entityFromDomain,
|
entityFromDomain,
|
||||||
hostnameFromURI,
|
hostnameFromURI,
|
||||||
} from './uri-utils.js';
|
} from './uri-utils.js';
|
||||||
|
|
||||||
|
import { MRUCache } from './mrucache.js';
|
||||||
|
import { ScriptletFilteringEngine } from './scriptlet-filtering-core.js';
|
||||||
|
|
||||||
|
import logger from './logger.js';
|
||||||
|
import { onBroadcast } from './broadcast.js';
|
||||||
|
import { redirectEngine as reng } from './redirect-engine.js';
|
||||||
|
import { sessionFirewall } from './filtering-engines.js';
|
||||||
|
import µb from './background.js';
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
const contentScriptRegisterer = new (class {
|
const contentScriptRegisterer = new (class {
|
||||||
|
@ -262,15 +259,13 @@ export class ScriptletFilteringEngineEx extends ScriptletFilteringEngine {
|
||||||
reset() {
|
reset() {
|
||||||
super.reset();
|
super.reset();
|
||||||
this.warSecret = vAPI.warSecret.long(this.warSecret);
|
this.warSecret = vAPI.warSecret.long(this.warSecret);
|
||||||
this.scriptletCache.reset();
|
this.clearCache();
|
||||||
contentScriptRegisterer.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
freeze() {
|
freeze() {
|
||||||
super.freeze();
|
super.freeze();
|
||||||
this.warSecret = vAPI.warSecret.long(this.warSecret);
|
this.warSecret = vAPI.warSecret.long(this.warSecret);
|
||||||
this.scriptletCache.reset();
|
this.clearCache();
|
||||||
contentScriptRegisterer.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clearCache() {
|
clearCache() {
|
||||||
|
@ -290,8 +285,7 @@ export class ScriptletFilteringEngineEx extends ScriptletFilteringEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.scriptletCache.resetTime < reng.modifyTime ) {
|
if ( this.scriptletCache.resetTime < reng.modifyTime ) {
|
||||||
this.warSecret = vAPI.warSecret.long(this.warSecret);
|
this.clearCache();
|
||||||
this.scriptletCache.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let scriptletDetails = this.scriptletCache.lookup(hostname);
|
let scriptletDetails = this.scriptletCache.lookup(hostname);
|
||||||
|
|
Loading…
Reference in New Issue