unprint 0.18.21 → 0.18.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/app.js +7 -7
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -1239,14 +1239,14 @@ async function getBrowserInstance(scope, options, useProxy = false) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
|
|
1241
1241
|
async function closeAllBrowsers() {
|
|
1242
|
-
const closingClients = Array.from(clients.values);
|
|
1242
|
+
const closingClients = Array.from(clients.values());
|
|
1243
1243
|
|
|
1244
1244
|
await Promise.all(closingClients.map(async (client) => client.browser.close()));
|
|
1245
1245
|
|
|
1246
|
-
events.emit('
|
|
1247
|
-
action: 'close',
|
|
1246
|
+
events.emit('browserClose', {
|
|
1248
1247
|
keys: closingClients.map((client) => client.key),
|
|
1249
1248
|
active: closingClients.reduce((acc, client) => acc + (client.active || 0), 0),
|
|
1249
|
+
retired: false,
|
|
1250
1250
|
});
|
|
1251
1251
|
}
|
|
1252
1252
|
|
|
@@ -1256,10 +1256,10 @@ async function closeBrowser(client, options) {
|
|
|
1256
1256
|
// this browser won't be reused
|
|
1257
1257
|
await client.browser.close();
|
|
1258
1258
|
|
|
1259
|
-
events.emit('
|
|
1260
|
-
action: 'close',
|
|
1259
|
+
events.emit('browserClose', {
|
|
1261
1260
|
keys: [client.key],
|
|
1262
1261
|
active: client.active,
|
|
1262
|
+
retired: !!client.retired,
|
|
1263
1263
|
});
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
@@ -1324,10 +1324,10 @@ async function browserRequest(url, customOptions = {}) {
|
|
|
1324
1324
|
return limiter.schedule(async () => {
|
|
1325
1325
|
const client = await getBrowserInstance(options.client, options, agent instanceof undici.ProxyAgent);
|
|
1326
1326
|
|
|
1327
|
-
events.emit('
|
|
1328
|
-
action: 'open',
|
|
1327
|
+
events.emit('browserOpen', {
|
|
1329
1328
|
keys: [client.key],
|
|
1330
1329
|
active: client.active,
|
|
1330
|
+
retired: false,
|
|
1331
1331
|
});
|
|
1332
1332
|
|
|
1333
1333
|
client.active += 1;
|