1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

code review for last commit

This commit is contained in:
gorhill 2015-04-07 21:58:19 -04:00
parent a2caf3c42d
commit 44bbf356f7
2 changed files with 6 additions and 8 deletions

View File

@ -693,12 +693,10 @@ PageStore.prototype.filterRequestNoCache = function(context) {
// https://github.com/chrisaljoudi/uBlock/pull/1209 // https://github.com/chrisaljoudi/uBlock/pull/1209
// Not ideal, but until something better is figured, this solves the issue. // 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 // Long term, I have some ideas I would like to test to take care of those
// store. Long term, I have some ideas I would like to test to take care // cases for which a page store may not have been definitely bound to a tab.
// of those cases for which a page store may not have been definitely if ( context.overrideStore ) {
// bound to a tab. if ( µb.getNetFilteringSwitch(context.requestURL) === false ) {
if ( typeof context.rootURL === 'string' ) {
if ( µb.getNetFilteringSwitch(context.rootURL) === false ) {
return ''; return '';
} }
} else if ( this.getNetFilteringSwitch() === false ) { } else if ( this.getNetFilteringSwitch() === false ) {

View File

@ -384,9 +384,9 @@ var onHeadersReceived = function(details) {
if ( details.parentFrameId === -1 ) { if ( details.parentFrameId === -1 ) {
var contextDomain = µb.URI.domainFromHostname(requestHostname); var contextDomain = µb.URI.domainFromHostname(requestHostname);
// https://github.com/chrisaljoudi/uBlock/pull/1209 // https://github.com/chrisaljoudi/uBlock/pull/1209
// Adding `rootURL` solves the issue. // Using `overrideStore` solves the issue.
context = { context = {
rootURL: requestURL, overrideStore: true,
rootHostname: requestHostname, rootHostname: requestHostname,
rootDomain: contextDomain, rootDomain: contextDomain,
pageHostname: requestHostname, pageHostname: requestHostname,