mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-04 16:47:15 +02:00
Minor generic code review of changes since 1.18.2
This commit is contained in:
parent
54eb608bc3
commit
656203adc7
@ -84,8 +84,7 @@ vAPI.messaging = {
|
|||||||
shuttingDown: false,
|
shuttingDown: false,
|
||||||
|
|
||||||
Connection: function(handler, details) {
|
Connection: function(handler, details) {
|
||||||
const messaging = vAPI.messaging;
|
this.messaging = vAPI.messaging;
|
||||||
this.messaging = messaging;
|
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
this.id = details.id;
|
this.id = details.id;
|
||||||
this.to = details.to;
|
this.to = details.to;
|
||||||
@ -95,7 +94,7 @@ vAPI.messaging = {
|
|||||||
this.checkTimer = undefined;
|
this.checkTimer = undefined;
|
||||||
// On Firefox it appears ports are not automatically disconnected
|
// On Firefox it appears ports are not automatically disconnected
|
||||||
// when navigating to another page.
|
// when navigating to another page.
|
||||||
const ctor = vAPI.messaging.Connection;
|
const ctor = this.messaging.Connection;
|
||||||
if ( ctor.pagehide !== undefined ) { return; }
|
if ( ctor.pagehide !== undefined ) { return; }
|
||||||
ctor.pagehide = ( ) => {
|
ctor.pagehide = ( ) => {
|
||||||
for ( const connection of this.messaging.connections.values() ) {
|
for ( const connection of this.messaging.connections.values() ) {
|
||||||
@ -270,7 +269,7 @@ vAPI.messaging = {
|
|||||||
// the main process is no longer reachable: memory leaks and bad
|
// the main process is no longer reachable: memory leaks and bad
|
||||||
// performance become a risk -- especially for long-lived, dynamic
|
// performance become a risk -- especially for long-lived, dynamic
|
||||||
// pages. Guard against this.
|
// pages. Guard against this.
|
||||||
if ( this.pending.size > 25 ) {
|
if ( this.pending.size > 50 ) {
|
||||||
vAPI.shutdown.exec();
|
vAPI.shutdown.exec();
|
||||||
}
|
}
|
||||||
const port = this.getPort();
|
const port = this.getPort();
|
||||||
@ -294,7 +293,7 @@ vAPI.messaging = {
|
|||||||
const port = this.getPort();
|
const port = this.getPort();
|
||||||
if ( port === null ) { return; }
|
if ( port === null ) { return; }
|
||||||
const connection = new this.Connection(handler, {
|
const connection = new this.Connection(handler, {
|
||||||
id: from + '-' + to + '-' + vAPI.sessionId,
|
id: `${from}-${to}-${vAPI.sessionId}`,
|
||||||
to: to,
|
to: to,
|
||||||
from: from,
|
from: from,
|
||||||
fromToken: port.name
|
fromToken: port.name
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"applications": {
|
"applications": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "uBlock0@raymondhill.net",
|
"id": "uBlock0@raymondhill.net",
|
||||||
"strict_min_version": "52.0"
|
"strict_min_version": "55.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"author": "All uBlock Origin contributors",
|
"author": "All uBlock Origin contributors",
|
||||||
|
@ -31,9 +31,7 @@
|
|||||||
try {
|
try {
|
||||||
let status = vAPI.uBO !== true;
|
let status = vAPI.uBO !== true;
|
||||||
if ( status === false && vAPI.bootstrap ) {
|
if ( status === false && vAPI.bootstrap ) {
|
||||||
self.requestIdleCallback(( ) => {
|
self.requestIdleCallback(( ) => vAPI && vAPI.bootstrap());
|
||||||
return vAPI && vAPI.bootstrap();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} catch(ex) {
|
} catch(ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user