unprint 0.18.20 → 0.18.22
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 +11 -3
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -1239,7 +1239,15 @@ async function getBrowserInstance(scope, options, useProxy = false) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
|
|
1241
1241
|
async function closeAllBrowsers() {
|
|
1242
|
-
|
|
1242
|
+
const closingClients = Array.from(clients.values());
|
|
1243
|
+
|
|
1244
|
+
await Promise.all(closingClients.map(async (client) => client.browser.close()));
|
|
1245
|
+
|
|
1246
|
+
events.emit('browser', {
|
|
1247
|
+
action: 'close',
|
|
1248
|
+
keys: closingClients.map((client) => client.key),
|
|
1249
|
+
active: closingClients.reduce((acc, client) => acc + (client.active || 0), 0),
|
|
1250
|
+
});
|
|
1243
1251
|
}
|
|
1244
1252
|
|
|
1245
1253
|
async function closeBrowser(client, options) {
|
|
@@ -1250,7 +1258,7 @@ async function closeBrowser(client, options) {
|
|
|
1250
1258
|
|
|
1251
1259
|
events.emit('browser', {
|
|
1252
1260
|
action: 'close',
|
|
1253
|
-
|
|
1261
|
+
keys: [client.key],
|
|
1254
1262
|
active: client.active,
|
|
1255
1263
|
});
|
|
1256
1264
|
}
|
|
@@ -1318,7 +1326,7 @@ async function browserRequest(url, customOptions = {}) {
|
|
|
1318
1326
|
|
|
1319
1327
|
events.emit('browser', {
|
|
1320
1328
|
action: 'open',
|
|
1321
|
-
|
|
1329
|
+
keys: [client.key],
|
|
1322
1330
|
active: client.active,
|
|
1323
1331
|
});
|
|
1324
1332
|
|