@browserless/screenshot 13.9.9 → 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.9",
5
+ "version": "13.9.11",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -32,24 +32,24 @@
32
32
  "web-capture"
33
33
  ],
34
34
  "dependencies": {
35
- "@browserless/errors": "13.6.10",
36
- "@browserless/goto": "13.9.9",
35
+ "@browserless/errors": "13.9.11",
36
+ "@browserless/goto": "13.9.10",
37
37
  "@kikobeats/content-type": "~1.0.4",
38
- "@kikobeats/time-span": "~1.0.12",
39
- "automad-prism-themes": "~0.3.7",
40
- "debug-logfmt": "~1.4.10",
38
+ "@kikobeats/time-span": "~1.0.13",
39
+ "automad-prism-themes": "~0.3.8",
40
+ "debug-logfmt": "~1.4.15",
41
41
  "got": "~11.8.6",
42
42
  "is-html-content": "~1.0.0",
43
43
  "is-url-http": "~2.3.13",
44
44
  "lodash": "~4.18.1",
45
45
  "map-values-deep": "~1.0.2",
46
46
  "mime": "~3.0.0",
47
- "null-prototype-object": "~1.2.6",
47
+ "null-prototype-object": "~1.2.7",
48
48
  "p-reflect": "~2.1.0",
49
49
  "pretty-ms": "~7.0.1",
50
50
  "prism-themes": "~1.9.0",
51
- "sharp": "~0.35.1",
52
- "svg-gradient": "~1.0.4"
51
+ "sharp": "~0.35.4",
52
+ "svg-gradient": "~1.0.5"
53
53
  },
54
54
  "devDependencies": {
55
55
  "ava": "5"
@@ -70,5 +70,5 @@
70
70
  "timeout": "2m",
71
71
  "workerThreads": false
72
72
  },
73
- "gitHead": "38ab34444ea6f6763b8ed79eb40adf673a0df1e9"
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?.name !== 'TargetCloseError' && !page.isClosed()
18
+ isContextDestroyed(error) && !isDeadTarget(error) && !page.isClosed()
16
19
 
17
20
  module.exports = isTransientContextLoss