@browserless/screenshot 13.9.10 → 13.9.11
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
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@browserless/screenshot",
|
|
3
3
|
"description": "Capture high-quality screenshots of websites with overlay support, device emulation, and automated image optimization.",
|
|
4
4
|
"homepage": "https://browserless.js.org/#/?id=screenshoturl-options",
|
|
5
|
-
"version": "13.9.
|
|
5
|
+
"version": "13.9.11",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"web-capture"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@browserless/errors": "13.9.
|
|
35
|
+
"@browserless/errors": "13.9.11",
|
|
36
36
|
"@browserless/goto": "13.9.10",
|
|
37
37
|
"@kikobeats/content-type": "~1.0.4",
|
|
38
38
|
"@kikobeats/time-span": "~1.0.13",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"timeout": "2m",
|
|
71
71
|
"workerThreads": false
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "14650c4bc4200824f4d6bb81e06853293fa4ddfb"
|
|
74
74
|
}
|
|
@@ -11,7 +11,10 @@ const { isContextDestroyed } = require('@browserless/errors')
|
|
|
11
11
|
// (`CdpSession.send` raises it the moment `detached` is set). Ask it as well as
|
|
12
12
|
// the page: the session flips first, so between the two there is a window where
|
|
13
13
|
// every call throws yet `isClosed()` still answers false.
|
|
14
|
+
const isDeadTarget = error =>
|
|
15
|
+
error?.name === 'TargetCloseError' || (error?.message || '').includes('Target closed')
|
|
16
|
+
|
|
14
17
|
const isTransientContextLoss = (page, error) =>
|
|
15
|
-
isContextDestroyed(error) && error
|
|
18
|
+
isContextDestroyed(error) && !isDeadTarget(error) && !page.isClosed()
|
|
16
19
|
|
|
17
20
|
module.exports = isTransientContextLoss
|