unprint 0.18.28 → 0.18.29
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/README.md +1 -0
- package/package.json +1 -1
- package/src/app.js +4 -0
package/README.md
CHANGED
|
@@ -233,6 +233,7 @@ Options
|
|
|
233
233
|
* `userAgent`: The default user agent header
|
|
234
234
|
* `browserUserAgent`: The default user agent header for browser-like requests (`get` interface `fetch` and `browserRequest`)
|
|
235
235
|
* `apiUserAgent`: The default user agent header for raw requests (`get` interface `request`)
|
|
236
|
+
* `useBrowser`: Forward the call to `unprint.browser()` (see below), only for GET-requests
|
|
236
237
|
|
|
237
238
|
Use Playwright with Chromium (experimental)
|
|
238
239
|
* `unprint.browser(url, [options])`
|
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -1503,6 +1503,10 @@ async function request(url, body, customOptions = {}, method = 'GET', redirects
|
|
|
1503
1503
|
url,
|
|
1504
1504
|
}, globalOptions, customOptions]);
|
|
1505
1505
|
|
|
1506
|
+
if (options.useBrowser) {
|
|
1507
|
+
return browserRequest(url, options);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1506
1510
|
const { limiter, interval, concurrency } = getLimiter(url, options);
|
|
1507
1511
|
|
|
1508
1512
|
const agent = getAgent(options, url);
|