mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
this fixes #1359
This commit is contained in:
parent
e209a632a6
commit
f044854068
@ -309,7 +309,7 @@ PageStore.prototype.init = function(tabId) {
|
||||
this.rawURL = tabContext.rawURL;
|
||||
this.hostnameToCountMap = {};
|
||||
this.contentLastModified = 0;
|
||||
this.frames = {};
|
||||
this.frames = Object.create(null);
|
||||
this.perLoadBlockedRequestCount = 0;
|
||||
this.perLoadAllowedRequestCount = 0;
|
||||
this.hiddenElementCount = ''; // Empty string means "unknown"
|
||||
@ -407,11 +407,9 @@ PageStore.prototype.dispose = function() {
|
||||
PageStore.prototype.disposeFrameStores = function() {
|
||||
var frames = this.frames;
|
||||
for ( var k in frames ) {
|
||||
if ( frames.hasOwnProperty(k) ) {
|
||||
frames[k].dispose();
|
||||
}
|
||||
frames[k].dispose();
|
||||
}
|
||||
this.frames = {};
|
||||
this.frames = Object.create(null);
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
@ -424,7 +422,7 @@ PageStore.prototype.getFrame = function(frameId) {
|
||||
|
||||
PageStore.prototype.setFrame = function(frameId, frameURL) {
|
||||
var frameStore = this.frames[frameId];
|
||||
if ( frameStore instanceof FrameStore ) {
|
||||
if ( frameStore ) {
|
||||
frameStore.init(this.rootHostname, frameURL);
|
||||
} else {
|
||||
this.frames[frameId] = FrameStore.factory(this.rootHostname, frameURL);
|
||||
@ -442,8 +440,8 @@ PageStore.prototype.createContextFromPage = function() {
|
||||
|
||||
PageStore.prototype.createContextFromFrameId = function(frameId) {
|
||||
var context = new µb.tabContextManager.createContext(this.tabId);
|
||||
if ( this.frames.hasOwnProperty(frameId) ) {
|
||||
var frameStore = this.frames[frameId];
|
||||
var frameStore = this.frames[frameId];
|
||||
if ( frameStore ) {
|
||||
context.pageHostname = frameStore.pageHostname;
|
||||
context.pageDomain = frameStore.pageDomain;
|
||||
} else {
|
||||
|
@ -106,14 +106,9 @@ var onBeforeRequest = function(details) {
|
||||
if ( µb.isAllowResult(result) ) {
|
||||
// https://github.com/chrisaljoudi/uBlock/issues/114
|
||||
frameId = details.frameId;
|
||||
if ( frameId > 0 ) {
|
||||
if ( isFrame ) {
|
||||
pageStore.setFrame(frameId, requestURL);
|
||||
} else if ( pageStore.getFrame(frameId) === null ) {
|
||||
pageStore.setFrame(frameId, requestURL);
|
||||
}
|
||||
if ( frameId > 0 && isFrame ) {
|
||||
pageStore.setFrame(frameId, requestURL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user