unprint 0.18.22 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/app.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.18.22",
3
+ "version": "0.18.23",
4
4
  "description": "Simplify common web scraping tasks while staying in control of the data.",
5
5
  "main": "src/app.js",
6
6
  "scripts": {},
package/src/app.js CHANGED
@@ -1243,10 +1243,10 @@ async function closeAllBrowsers() {
1243
1243
 
1244
1244
  await Promise.all(closingClients.map(async (client) => client.browser.close()));
1245
1245
 
1246
- events.emit('browser', {
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('browser', {
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('browser', {
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;