aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-04-07 21:26:13 -0400
committergorhill <rhill@raymondhill.net>2015-04-07 21:26:13 -0400
commita2caf3c42dfa21183954fd6cdfc220c5645e742f (patch)
tree3e5632ccfbf69d8facef114cf6dc884bd31a5783
parent31bea1d08bd892f99426046895d3c393491f17d8 (diff)
downloaduBlock-a2caf3c42dfa21183954fd6cdfc220c5645e742f.zip
uBlock-a2caf3c42dfa21183954fd6cdfc220c5645e742f.tar.gz
uBlock-a2caf3c42dfa21183954fd6cdfc220c5645e742f.tar.bz2
this fixes https://github.com/chrisaljoudi/uBlock/issues/1205
-rw-r--r--src/js/pagestore.js12
-rw-r--r--src/js/traffic.js5
2 files changed, 15 insertions, 2 deletions
diff --git a/src/js/pagestore.js b/src/js/pagestore.js
index 91af6b1..eb37bb3 100644
--- a/src/js/pagestore.js
+++ b/src/js/pagestore.js
@@ -691,7 +691,17 @@ var collapsibleRequestTypes = 'image sub_frame object';
PageStore.prototype.filterRequestNoCache = function(context) {
- if ( this.getNetFilteringSwitch() === false ) {
+ // https://github.com/chrisaljoudi/uBlock/pull/1209
+ // Not ideal, but until something better is figured, this solves the issue.
+ // This works so long as there is no `rootURL` property added to the page
+ // store. Long term, I have some ideas I would like to test to take care
+ // of those cases for which a page store may not have been definitely
+ // bound to a tab.
+ if ( typeof context.rootURL === 'string' ) {
+ if ( µb.getNetFilteringSwitch(context.rootURL) === false ) {
+ return '';
+ }
+ } else if ( this.getNetFilteringSwitch() === false ) {
return '';
}
diff --git a/src/js/traffic.js b/src/js/traffic.js
index 4e90c12..2201fdd 100644
--- a/src/js/traffic.js
+++ b/src/js/traffic.js
@@ -383,7 +383,10 @@ var onHeadersReceived = function(details) {
var context;
if ( details.parentFrameId === -1 ) {
var contextDomain = µb.URI.domainFromHostname(requestHostname);
+ // https://github.com/chrisaljoudi/uBlock/pull/1209
+ // Adding `rootURL` solves the issue.
context = {
+ rootURL: requestURL,
rootHostname: requestHostname,
rootDomain: contextDomain,
pageHostname: requestHostname,
@@ -401,7 +404,7 @@ var onHeadersReceived = function(details) {
context.requestHostname = requestHostname;
context.requestType = 'inline-script';
- var result = pageStore.filterRequest(context);
+ var result = pageStore.filterRequestNoCache(context);
pageStore.logRequest(context, result);