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

fix regression on Pale Moon from 5704a90cf0

This commit is contained in:
gorhill 2016-08-06 15:27:33 -04:00
parent 4b005f4635
commit ffc3bd10f6

View File

@ -94,6 +94,7 @@ var contentObserver = {
popupMessageName: hostName + ':shouldLoadPopup', popupMessageName: hostName + ':shouldLoadPopup',
ignoredPopups: new WeakMap(), ignoredPopups: new WeakMap(),
uniqueSandboxId: 1, uniqueSandboxId: 1,
canE10S: Services.vc.compare(Services.appinfo.platformVersion, '44') > 0,
get componentRegistrar() { get componentRegistrar() {
return Components.manager.QueryInterface(Ci.nsIComponentRegistrar); return Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
@ -239,7 +240,8 @@ var contentObserver = {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1232354 // https://bugzilla.mozilla.org/show_bug.cgi?id=1232354
// For top-level resources, no need to send information to the // For top-level resources, no need to send information to the
// main process. // main process.
if ( context === context.top ) { let isTopContext = context === context.top;
if ( isTopContext && this.canE10S ) {
return this.ACCEPT; return this.ACCEPT;
} }
@ -248,9 +250,18 @@ var contentObserver = {
return this.ACCEPT; return this.ACCEPT;
} }
var parentFrameId;
if ( isTopContext ) {
parentFrameId = -1;
} else if ( context.parent === context.top ) {
parentFrameId = 0;
} else {
parentFrameId = this.getFrameId(context.parent);
}
let rpcData = this.rpcData; let rpcData = this.rpcData;
rpcData.frameId = this.getFrameId(context); rpcData.frameId = isTopContext ? 0 : this.getFrameId(context);
rpcData.pFrameId = context.parent === context.top ? 0 : this.getFrameId(context.parent); rpcData.pFrameId = parentFrameId;
rpcData.type = type; rpcData.type = type;
rpcData.url = location.spec; rpcData.url = location.spec;