Minor generic code review of changes since 1.18.2

This commit is contained in:
Raymond Hill 2019-02-02 08:09:34 -05:00
parent 54eb608bc3
commit 656203adc7
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 6 additions and 9 deletions

View File

@ -84,8 +84,7 @@ vAPI.messaging = {
shuttingDown: false,
Connection: function(handler, details) {
const messaging = vAPI.messaging;
this.messaging = messaging;
this.messaging = vAPI.messaging;
this.handler = handler;
this.id = details.id;
this.to = details.to;
@ -95,7 +94,7 @@ vAPI.messaging = {
this.checkTimer = undefined;
// On Firefox it appears ports are not automatically disconnected
// when navigating to another page.
const ctor = vAPI.messaging.Connection;
const ctor = this.messaging.Connection;
if ( ctor.pagehide !== undefined ) { return; }
ctor.pagehide = ( ) => {
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
// performance become a risk -- especially for long-lived, dynamic
// pages. Guard against this.
if ( this.pending.size > 25 ) {
if ( this.pending.size > 50 ) {
vAPI.shutdown.exec();
}
const port = this.getPort();
@ -294,7 +293,7 @@ vAPI.messaging = {
const port = this.getPort();
if ( port === null ) { return; }
const connection = new this.Connection(handler, {
id: from + '-' + to + '-' + vAPI.sessionId,
id: `${from}-${to}-${vAPI.sessionId}`,
to: to,
from: from,
fromToken: port.name

View File

@ -2,7 +2,7 @@
"applications": {
"gecko": {
"id": "uBlock0@raymondhill.net",
"strict_min_version": "52.0"
"strict_min_version": "55.0"
}
},
"author": "All uBlock Origin contributors",

View File

@ -31,9 +31,7 @@
try {
let status = vAPI.uBO !== true;
if ( status === false && vAPI.bootstrap ) {
self.requestIdleCallback(( ) => {
return vAPI && vAPI.bootstrap();
});
self.requestIdleCallback(( ) => vAPI && vAPI.bootstrap());
}
return status;
} catch(ex) {