aboutsummaryrefslogtreecommitdiffstats
path: root/js/pagestore.js
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2014-10-10 10:07:50 -0400
committergorhill <rhill@raymondhill.net>2014-10-10 10:07:50 -0400
commitfdb5335c7ce3163345d05494292cff2fbbb6ef1d (patch)
tree4d65e4317e30e3b634b6b0eeb2100d8d08f3b404 /js/pagestore.js
parent51bfd5528b92ae68276ef688b9d604b4f99d1db7 (diff)
downloaduBlock-fdb5335c7ce3163345d05494292cff2fbbb6ef1d.zip
uBlock-fdb5335c7ce3163345d05494292cff2fbbb6ef1d.tar.gz
uBlock-fdb5335c7ce3163345d05494292cff2fbbb6ef1d.tar.bz2
this fixes #294
Diffstat (limited to 'js/pagestore.js')
-rw-r--r--js/pagestore.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/js/pagestore.js b/js/pagestore.js
index 6d8b737..dce9b89 100644
--- a/js/pagestore.js
+++ b/js/pagestore.js
@@ -407,13 +407,16 @@ PageStore.prototype.getNetFilteringSwitch = function() {
/******************************************************************************/
PageStore.prototype.filterRequest = function(context, requestType, requestURL) {
- var entry = this.netFilteringCache.lookup(requestURL);
- if ( entry !== undefined ) {
- //console.debug(' cache HIT: PageStore.filterRequest("%s")', requestURL);
- return entry.result;
+ var result = '';
+ if ( this.getNetFilteringSwitch() ) {
+ var entry = this.netFilteringCache.lookup(requestURL);
+ if ( entry !== undefined ) {
+ //console.debug(' cache HIT: PageStore.filterRequest("%s")', requestURL);
+ return entry.result;
+ }
+ //console.debug('cache MISS: PageStore.filterRequest("%s")', requestURL);
+ result = µb.netFilteringEngine.matchString(context, requestURL, requestType);
}
- //console.debug('cache MISS: PageStore.filterRequest("%s")', requestURL);
- var result = µb.netFilteringEngine.matchString(context, requestURL, requestType);
if ( collapsibleRequestTypes.indexOf(requestType) !== -1 || µb.userSettings.logRequests ) {
this.netFilteringCache.add(requestURL, result, requestType, 0);
}