unprint 0.19.17 → 0.19.19
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 +8 -7
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -1225,10 +1225,10 @@ async function getBrowserContext(browser, options, useProxy) {
|
|
|
1225
1225
|
server: `${options.proxy.host}:${options.proxy.port}`,
|
|
1226
1226
|
},
|
|
1227
1227
|
}),
|
|
1228
|
-
extraHTTPHeaders: {
|
|
1228
|
+
extraHTTPHeaders: curateHeaders({
|
|
1229
1229
|
...options.headers,
|
|
1230
1230
|
cookie: getCookie(options),
|
|
1231
|
-
},
|
|
1231
|
+
}, options),
|
|
1232
1232
|
});
|
|
1233
1233
|
}
|
|
1234
1234
|
|
|
@@ -1286,12 +1286,13 @@ async function getBrowserInstance(scope, options, useProxy = false, useRemote =
|
|
|
1286
1286
|
}
|
|
1287
1287
|
|
|
1288
1288
|
try {
|
|
1289
|
-
const { browser, context } = await launchers;
|
|
1289
|
+
// const { browser, context } = await launchers;
|
|
1290
|
+
const { browser } = await launchers;
|
|
1290
1291
|
|
|
1291
|
-
context.setDefaultNavigationTimeout(options.timeout);
|
|
1292
|
+
// context.setDefaultNavigationTimeout(options.timeout);
|
|
1292
1293
|
|
|
1293
1294
|
client.browser = browser;
|
|
1294
|
-
client.context = context;
|
|
1295
|
+
// client.context = context;
|
|
1295
1296
|
} catch (error) {
|
|
1296
1297
|
clients.delete(scopeKey);
|
|
1297
1298
|
|
|
@@ -1309,7 +1310,7 @@ async function closeAllBrowsers() {
|
|
|
1309
1310
|
const closingClients = Array.from(clients.values());
|
|
1310
1311
|
|
|
1311
1312
|
await Promise.all(closingClients.map(async (client) => {
|
|
1312
|
-
await client.context
|
|
1313
|
+
await client.context?.close();
|
|
1313
1314
|
await client.browser.close();
|
|
1314
1315
|
|
|
1315
1316
|
clients.delete(client.key);
|
|
@@ -1327,7 +1328,7 @@ async function closeBrowser(client, options = {}) {
|
|
|
1327
1328
|
if (options.client === null // this browser is single-use
|
|
1328
1329
|
|| (client.retired && client.active === 0)) { // this browser is retired to minimize garbage build-up
|
|
1329
1330
|
// this browser won't be reused, browser close DOES NOT automatically close context https://github.com/microsoft/playwright/issues/15163
|
|
1330
|
-
await client.context
|
|
1331
|
+
await client.context?.close();
|
|
1331
1332
|
await client.browser.close();
|
|
1332
1333
|
|
|
1333
1334
|
clients.delete(client.key);
|