browserless 9.11.1-0 → 9.11.1-1
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/index.js +3 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "browserless",
|
|
3
3
|
"description": "The headless Chrome/Chromium performance driver for Node.js",
|
|
4
4
|
"homepage": "https://browserless.js.org",
|
|
5
|
-
"version": "9.11.1-
|
|
5
|
+
"version": "9.11.1-1",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
package/src/index.js
CHANGED
|
@@ -112,14 +112,15 @@ module.exports = ({ timeout: globalTimeout = 30000, ...launchOpts } = {}) => {
|
|
|
112
112
|
PCancelable.fn(async (...args) => {
|
|
113
113
|
const onCancel = args.pop()
|
|
114
114
|
let isRejected = false
|
|
115
|
+
let close
|
|
115
116
|
|
|
116
117
|
async function run () {
|
|
117
118
|
let page
|
|
118
119
|
|
|
119
120
|
try {
|
|
120
121
|
page = await createPage(args)
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
close = () => closePage(page)
|
|
123
|
+
onCancel(close)
|
|
123
124
|
setTimeout(close, timeout).unref()
|
|
124
125
|
const value = await fn(page)(...args)
|
|
125
126
|
await closePage(page)
|