1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00
This commit is contained in:
gorhill 2016-08-05 22:43:10 -04:00
parent 6a8be4bdeb
commit 5704a90cf0

View File

@ -236,14 +236,11 @@ var contentObserver = {
return this.ACCEPT;
}
let isTopLevel = context === context.top;
let parentFrameId;
if ( isTopLevel ) {
parentFrameId = -1;
} else if ( context.parent === context.top ) {
parentFrameId = 0;
} else {
parentFrameId = this.getFrameId(context.parent);
// https://bugzilla.mozilla.org/show_bug.cgi?id=1232354
// For top-level resources, no need to send information to the
// main process.
if ( context === context.top ) {
return this.ACCEPT;
}
let messageManager = getMessageManager(context);
@ -252,8 +249,8 @@ var contentObserver = {
}
let details = {
frameId: isTopLevel ? 0 : this.getFrameId(context),
parentFrameId: parentFrameId,
frameId: this.getFrameId(context),
parentFrameId: context.parent === context.top ? 0 : this.getFrameId(context.parent),
rawtype: type,
tabId: '',
url: location.spec