@browserless/screenshot 13.6.0 → 13.6.2
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 +4 -4
- package/src/index.js +14 -6
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.6.
|
|
5
|
+
"version": "13.6.2",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@browserless/errors": "13.1.7",
|
|
36
|
-
"@browserless/goto": "13.6.
|
|
36
|
+
"@browserless/goto": "13.6.2",
|
|
37
37
|
"@kikobeats/content-type": "~1.0.4",
|
|
38
38
|
"@kikobeats/time-span": "~1.0.12",
|
|
39
39
|
"automad-prism-themes": "~0.3.7",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"svg-gradient": "~1.0.4"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@browserless/test": "13.6.
|
|
55
|
+
"@browserless/test": "13.6.2",
|
|
56
56
|
"ava": "5"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"timeout": "2m",
|
|
72
72
|
"workerThreads": false
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "7c7c6fee9e82050887d5499ed9dc3bac16c88c42"
|
|
75
75
|
}
|
package/src/index.js
CHANGED
|
@@ -109,6 +109,14 @@ const waitForElement = async (page, element) => {
|
|
|
109
109
|
return screenshotOpts
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
const SCREENSHOT_DEFAULT_OPTS = {
|
|
113
|
+
codeScheme: 'atom-dark',
|
|
114
|
+
overlay: {},
|
|
115
|
+
waitUntil: 'auto',
|
|
116
|
+
waitForDom: DEFAULT_WAIT_FOR_DOM,
|
|
117
|
+
isPageReady: defaultIsPageReady
|
|
118
|
+
}
|
|
119
|
+
|
|
112
120
|
module.exports = ({ goto, ...gotoOpts }) => {
|
|
113
121
|
goto = goto || createGoto(gotoOpts)
|
|
114
122
|
|
|
@@ -116,11 +124,11 @@ module.exports = ({ goto, ...gotoOpts }) => {
|
|
|
116
124
|
return async (
|
|
117
125
|
url,
|
|
118
126
|
{
|
|
119
|
-
codeScheme =
|
|
120
|
-
overlay: overlayOpts =
|
|
121
|
-
waitUntil =
|
|
122
|
-
waitForDom =
|
|
123
|
-
isPageReady =
|
|
127
|
+
codeScheme = SCREENSHOT_DEFAULT_OPTS.codeScheme,
|
|
128
|
+
overlay: overlayOpts = SCREENSHOT_DEFAULT_OPTS.overlay,
|
|
129
|
+
waitUntil = SCREENSHOT_DEFAULT_OPTS.waitUntil,
|
|
130
|
+
waitForDom = SCREENSHOT_DEFAULT_OPTS.waitForDom,
|
|
131
|
+
isPageReady = SCREENSHOT_DEFAULT_OPTS.isPageReady,
|
|
124
132
|
...opts
|
|
125
133
|
} = {}
|
|
126
134
|
) => {
|
|
@@ -269,4 +277,4 @@ module.exports.captureWithNavigationRetry = captureWithNavigationRetry
|
|
|
269
277
|
module.exports.isWhiteScreenshot = isWhiteScreenshot
|
|
270
278
|
module.exports.waitForDomStability = waitForDomStability
|
|
271
279
|
module.exports.resolveWaitForDom = resolveWaitForDom
|
|
272
|
-
module.exports.
|
|
280
|
+
module.exports.SCREENSHOT_DEFAULT_OPTS = SCREENSHOT_DEFAULT_OPTS
|