mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
improve performance issue reported at https://bugzilla.mozilla.org/show_bug.cgi?id=1232354
This commit is contained in:
parent
6a8be4bdeb
commit
5704a90cf0
@ -236,14 +236,11 @@ var contentObserver = {
|
|||||||
return this.ACCEPT;
|
return this.ACCEPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
let isTopLevel = context === context.top;
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1232354
|
||||||
let parentFrameId;
|
// For top-level resources, no need to send information to the
|
||||||
if ( isTopLevel ) {
|
// main process.
|
||||||
parentFrameId = -1;
|
if ( context === context.top ) {
|
||||||
} else if ( context.parent === context.top ) {
|
return this.ACCEPT;
|
||||||
parentFrameId = 0;
|
|
||||||
} else {
|
|
||||||
parentFrameId = this.getFrameId(context.parent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let messageManager = getMessageManager(context);
|
let messageManager = getMessageManager(context);
|
||||||
@ -252,8 +249,8 @@ var contentObserver = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let details = {
|
let details = {
|
||||||
frameId: isTopLevel ? 0 : this.getFrameId(context),
|
frameId: this.getFrameId(context),
|
||||||
parentFrameId: parentFrameId,
|
parentFrameId: context.parent === context.top ? 0 : this.getFrameId(context.parent),
|
||||||
rawtype: type,
|
rawtype: type,
|
||||||
tabId: '',
|
tabId: '',
|
||||||
url: location.spec
|
url: location.spec
|
||||||
|
Loading…
Reference in New Issue
Block a user