@browserless.io/browserless 2.24.3 → 2.25.0
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/CHANGELOG.md +17 -1
- package/README.md +1 -1
- package/build/browserless.js +3 -1
- package/build/browsers/browsers.cdp.d.ts +3 -0
- package/build/browsers/browsers.cdp.js +4 -1
- package/build/browsers/browsers.playwright.d.ts +4 -0
- package/build/browsers/browsers.playwright.js +5 -1
- package/build/browsers/index.js +3 -2
- package/build/http.d.ts +9 -0
- package/build/http.js +9 -0
- package/build/routes/chrome/http/content.post.body.json +8 -8
- package/build/routes/chrome/http/pdf.post.body.json +8 -8
- package/build/routes/chrome/http/scrape.post.body.json +8 -8
- package/build/routes/chrome/http/screenshot.post.body.json +8 -8
- package/build/routes/chrome/tests/kill-sessions.spec.js +1 -1
- package/build/routes/chromium/http/content.post.body.json +8 -8
- package/build/routes/chromium/http/pdf.post.body.json +8 -8
- package/build/routes/chromium/http/scrape.post.body.json +8 -8
- package/build/routes/chromium/http/screenshot.post.body.json +8 -8
- package/build/routes/chromium/tests/kill-sessions.spec.js +1 -1
- package/build/routes/edge/http/content.post.body.json +579 -0
- package/build/routes/edge/http/content.post.d.ts +8 -0
- package/build/routes/edge/http/content.post.js +7 -0
- package/build/routes/edge/http/content.post.query.json +183 -0
- package/build/routes/edge/http/content.post.response.json +5 -0
- package/build/routes/edge/http/download.post.body.json +32 -0
- package/build/routes/edge/http/download.post.d.ts +8 -0
- package/build/routes/edge/http/download.post.js +7 -0
- package/build/routes/edge/http/download.post.query.json +120 -0
- package/build/routes/edge/http/download.post.response.json +4 -0
- package/build/routes/edge/http/function.post.body.json +32 -0
- package/build/routes/edge/http/function.post.d.ts +8 -0
- package/build/routes/edge/http/function.post.js +7 -0
- package/build/routes/edge/http/function.post.query.json +120 -0
- package/build/routes/edge/http/function.post.response.json +4 -0
- package/build/routes/edge/http/json-list.get.d.ts +5 -0
- package/build/routes/edge/http/json-list.get.js +5 -0
- package/build/routes/edge/http/json-list.get.response.json +52 -0
- package/build/routes/edge/http/json-new.put.d.ts +5 -0
- package/build/routes/edge/http/json-new.put.js +5 -0
- package/build/routes/edge/http/json-new.put.response.json +44 -0
- package/build/routes/edge/http/json-protocol.get.d.ts +5 -0
- package/build/routes/edge/http/json-protocol.get.js +5 -0
- package/build/routes/edge/http/json-protocol.get.response.json +6 -0
- package/build/routes/edge/http/json-version.get.d.ts +5 -0
- package/build/routes/edge/http/json-version.get.js +5 -0
- package/build/routes/edge/http/json-version.get.response.json +44 -0
- package/build/routes/edge/http/pdf.post.body.json +724 -0
- package/build/routes/edge/http/pdf.post.d.ts +8 -0
- package/build/routes/edge/http/pdf.post.js +7 -0
- package/build/routes/edge/http/pdf.post.query.json +120 -0
- package/build/routes/edge/http/pdf.post.response.json +5 -0
- package/build/routes/edge/http/performance.post.body.json +26 -0
- package/build/routes/edge/http/performance.post.d.ts +8 -0
- package/build/routes/edge/http/performance.post.js +7 -0
- package/build/routes/edge/http/performance.post.query.json +120 -0
- package/build/routes/edge/http/performance.post.response.json +7 -0
- package/build/routes/edge/http/scrape.post.body.json +626 -0
- package/build/routes/edge/http/scrape.post.d.ts +8 -0
- package/build/routes/edge/http/scrape.post.js +7 -0
- package/build/routes/edge/http/scrape.post.query.json +183 -0
- package/build/routes/edge/http/scrape.post.response.json +334 -0
- package/build/routes/edge/http/screenshot.post.body.json +669 -0
- package/build/routes/edge/http/screenshot.post.d.ts +8 -0
- package/build/routes/edge/http/screenshot.post.js +7 -0
- package/build/routes/edge/http/screenshot.post.query.json +120 -0
- package/build/routes/edge/http/screenshot.post.response.json +5 -0
- package/build/routes/edge/tests/content.spec.d.ts +1 -0
- package/build/routes/edge/tests/content.spec.js +312 -0
- package/build/routes/edge/tests/download.spec.d.ts +1 -0
- package/build/routes/edge/tests/download.spec.js +67 -0
- package/build/routes/edge/tests/function.spec.d.ts +1 -0
- package/build/routes/edge/tests/function.spec.js +277 -0
- package/build/routes/edge/tests/json-version.spec.d.ts +1 -0
- package/build/routes/edge/tests/json-version.spec.js +37 -0
- package/build/routes/edge/tests/kill-sessions.spec.d.ts +1 -0
- package/build/routes/edge/tests/kill-sessions.spec.js +80 -0
- package/build/routes/edge/tests/page-websocket.spec.d.ts +1 -0
- package/build/routes/edge/tests/page-websocket.spec.js +97 -0
- package/build/routes/edge/tests/pdf.spec.d.ts +1 -0
- package/build/routes/edge/tests/pdf.spec.js +345 -0
- package/build/routes/edge/tests/performance.spec.d.ts +1 -0
- package/build/routes/edge/tests/performance.spec.js +124 -0
- package/build/routes/edge/tests/scrape.spec.d.ts +1 -0
- package/build/routes/edge/tests/scrape.spec.js +354 -0
- package/build/routes/edge/tests/screenshot.spec.d.ts +1 -0
- package/build/routes/edge/tests/screenshot.spec.js +339 -0
- package/build/routes/edge/tests/websocket.spec.d.ts +1 -0
- package/build/routes/edge/tests/websocket.spec.js +384 -0
- package/build/routes/edge/ws/browser.d.ts +7 -0
- package/build/routes/edge/ws/browser.js +6 -0
- package/build/routes/edge/ws/browser.query.json +120 -0
- package/build/routes/edge/ws/cdp.d.ts +8 -0
- package/build/routes/edge/ws/cdp.js +7 -0
- package/build/routes/edge/ws/cdp.query.json +120 -0
- package/build/routes/edge/ws/page.d.ts +8 -0
- package/build/routes/edge/ws/page.js +7 -0
- package/build/routes/edge/ws/page.query.json +120 -0
- package/build/routes/edge/ws/playwright.d.ts +8 -0
- package/build/routes/edge/ws/playwright.js +7 -0
- package/build/routes/edge/ws/playwright.query.json +100 -0
- package/build/routes/firefox/tests/kill-sessions.spec.js +1 -1
- package/build/routes/webkit/tests/kill-sessions.spec.js +1 -1
- package/build/sdk-utils.js +1 -1
- package/build/shared/scrape.http.js +2 -2
- package/build/types.d.ts +32 -0
- package/build/types.js +18 -0
- package/build/utils.d.ts +1 -0
- package/build/utils.js +16 -2
- package/docker/chrome/Dockerfile +14 -14
- package/docker/chromium/Dockerfile +14 -14
- package/docker/edge/.dockerignore +16 -0
- package/docker/edge/Dockerfile +43 -0
- package/docker/firefox/Dockerfile +14 -14
- package/docker/multi/Dockerfile +18 -18
- package/docker/sdk/Dockerfile +10 -0
- package/package.json +18 -18
- package/src/browserless.ts +4 -0
- package/src/browsers/browsers.cdp.ts +5 -0
- package/src/browsers/browsers.playwright.ts +6 -0
- package/src/browsers/index.ts +4 -1
- package/src/http.ts +9 -0
- package/src/routes/chrome/tests/kill-sessions.spec.ts +1 -1
- package/src/routes/chromium/tests/kill-sessions.spec.ts +1 -1
- package/src/routes/edge/http/content.post.ts +20 -0
- package/src/routes/edge/http/download.post.ts +20 -0
- package/src/routes/edge/http/function.post.ts +20 -0
- package/src/routes/edge/http/json-list.get.ts +7 -0
- package/src/routes/edge/http/json-new.put.ts +7 -0
- package/src/routes/edge/http/json-protocol.get.ts +7 -0
- package/src/routes/edge/http/json-version.get.ts +7 -0
- package/src/routes/edge/http/pdf.post.ts +20 -0
- package/src/routes/edge/http/performance.post.ts +20 -0
- package/src/routes/edge/http/scrape.post.ts +20 -0
- package/src/routes/edge/http/screenshot.post.ts +20 -0
- package/src/routes/edge/tests/content.spec.ts +376 -0
- package/src/routes/edge/tests/download.spec.ts +77 -0
- package/src/routes/edge/tests/function.spec.ts +317 -0
- package/src/routes/edge/tests/json-version.spec.ts +52 -0
- package/src/routes/edge/tests/kill-sessions.spec.ts +99 -0
- package/src/routes/edge/tests/page-websocket.spec.ts +129 -0
- package/src/routes/edge/tests/pdf.spec.ts +389 -0
- package/src/routes/edge/tests/performance.spec.ts +155 -0
- package/src/routes/edge/tests/scrape.spec.ts +417 -0
- package/src/routes/edge/tests/screenshot.spec.ts +387 -0
- package/src/routes/edge/tests/websocket.spec.ts +510 -0
- package/src/routes/edge/ws/browser.ts +10 -0
- package/src/routes/edge/ws/cdp.ts +17 -0
- package/src/routes/edge/ws/page.ts +10 -0
- package/src/routes/edge/ws/playwright.ts +17 -0
- package/src/routes/firefox/tests/kill-sessions.spec.ts +1 -1
- package/src/routes/webkit/tests/kill-sessions.spec.ts +1 -1
- package/src/sdk-utils.ts +1 -1
- package/src/shared/scrape.http.ts +2 -2
- package/src/types.ts +19 -0
- package/src/utils.ts +38 -16
- package/static/docs/swagger.json +2097 -10
- package/static/docs/swagger.min.json +2096 -9
- package/static/function/client.js +76 -68
- package/static/function/index.html +76 -68
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"addScriptTag": {
|
|
5
|
+
"type": "array",
|
|
6
|
+
"items": {
|
|
7
|
+
"$ref": "#/definitions/FrameAddScriptTagOptions"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"addStyleTag": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"$ref": "#/definitions/FrameAddStyleTagOptions"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"authenticate": {
|
|
17
|
+
"anyOf": [
|
|
18
|
+
{
|
|
19
|
+
"$ref": "#/definitions/Credentials"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "null"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"bestAttempt": {
|
|
27
|
+
"description": "When bestAttempt is set to true, browserless attempt to proceed\nwhen \"awaited\" events fail or timeout. This includes things like\ngoto, waitForSelector, and more.",
|
|
28
|
+
"type": "boolean"
|
|
29
|
+
},
|
|
30
|
+
"cookies": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"$ref": "#/definitions/CookieParam"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"debugOpts": {
|
|
37
|
+
"$ref": "#/definitions/ScrapeDebugOptions"
|
|
38
|
+
},
|
|
39
|
+
"elements": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"$ref": "#/definitions/ScrapeElementSelector"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"emulateMediaType": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"gotoOptions": {
|
|
49
|
+
"$ref": "#/definitions/GoToOptions"
|
|
50
|
+
},
|
|
51
|
+
"html": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"rejectRequestPattern": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"rejectResourceTypes": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {
|
|
63
|
+
"enum": [
|
|
64
|
+
"cspviolationreport",
|
|
65
|
+
"document",
|
|
66
|
+
"eventsource",
|
|
67
|
+
"fetch",
|
|
68
|
+
"font",
|
|
69
|
+
"image",
|
|
70
|
+
"manifest",
|
|
71
|
+
"media",
|
|
72
|
+
"other",
|
|
73
|
+
"ping",
|
|
74
|
+
"prefetch",
|
|
75
|
+
"preflight",
|
|
76
|
+
"script",
|
|
77
|
+
"signedexchange",
|
|
78
|
+
"stylesheet",
|
|
79
|
+
"texttrack",
|
|
80
|
+
"websocket",
|
|
81
|
+
"xhr"
|
|
82
|
+
],
|
|
83
|
+
"type": "string"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"requestInterceptors": {
|
|
87
|
+
"type": "array",
|
|
88
|
+
"items": {
|
|
89
|
+
"description": "An array of patterns (using `req.url().match(r.pattern)` to match) and their\ncorresponding responses to use in order to fulfill those requests.",
|
|
90
|
+
"type": "object",
|
|
91
|
+
"properties": {
|
|
92
|
+
"pattern": {
|
|
93
|
+
"description": "An array of patterns (using `req.url().match(r.pattern)` to match) and their\ncorresponding responses to use in order to fulfill those requests.",
|
|
94
|
+
"type": "string"
|
|
95
|
+
},
|
|
96
|
+
"response": {
|
|
97
|
+
"$ref": "#/definitions/Partial<ResponseForRequest>"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"required": [
|
|
102
|
+
"pattern",
|
|
103
|
+
"response"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"setExtraHTTPHeaders": {
|
|
108
|
+
"$ref": "#/definitions/Record<string,string>"
|
|
109
|
+
},
|
|
110
|
+
"setJavaScriptEnabled": {
|
|
111
|
+
"type": "boolean"
|
|
112
|
+
},
|
|
113
|
+
"url": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"userAgent": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"viewport": {
|
|
120
|
+
"anyOf": [
|
|
121
|
+
{
|
|
122
|
+
"$ref": "#/definitions/Viewport"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "null"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"waitForEvent": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"properties": {
|
|
132
|
+
"event": {
|
|
133
|
+
"type": "string"
|
|
134
|
+
},
|
|
135
|
+
"timeout": {
|
|
136
|
+
"type": "number"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"additionalProperties": false,
|
|
140
|
+
"required": [
|
|
141
|
+
"event"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"waitForFunction": {
|
|
145
|
+
"type": "object",
|
|
146
|
+
"properties": {
|
|
147
|
+
"fn": {
|
|
148
|
+
"description": "The function, or statement, to be evaluated in browser context",
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
"polling": {
|
|
152
|
+
"description": "An interval at which the pageFunction is executed, defaults to raf.\nIf polling is a number, then it is treated as an interval in milliseconds\nat which the function would be executed. If polling is a string,\nthen it can be one of the following values: \"raf\" or \"mutation\"",
|
|
153
|
+
"type": [
|
|
154
|
+
"string",
|
|
155
|
+
"number"
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"timeout": {
|
|
159
|
+
"description": "Maximum time to wait for in milliseconds. Defaults to 30000 (30 seconds).\nPass 0 to disable timeout.",
|
|
160
|
+
"type": "number"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"additionalProperties": false,
|
|
164
|
+
"required": [
|
|
165
|
+
"fn"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"waitForSelector": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"properties": {
|
|
171
|
+
"hidden": {
|
|
172
|
+
"type": "boolean"
|
|
173
|
+
},
|
|
174
|
+
"selector": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"timeout": {
|
|
178
|
+
"type": "number"
|
|
179
|
+
},
|
|
180
|
+
"visible": {
|
|
181
|
+
"type": "boolean"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"required": [
|
|
186
|
+
"selector"
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
"waitForTimeout": {
|
|
190
|
+
"type": "number"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"required": [
|
|
195
|
+
"elements"
|
|
196
|
+
],
|
|
197
|
+
"definitions": {
|
|
198
|
+
"FrameAddScriptTagOptions": {
|
|
199
|
+
"type": "object",
|
|
200
|
+
"properties": {
|
|
201
|
+
"url": {
|
|
202
|
+
"description": "URL of the script to be added.",
|
|
203
|
+
"type": "string"
|
|
204
|
+
},
|
|
205
|
+
"path": {
|
|
206
|
+
"description": "Path to a JavaScript file to be injected into the frame.",
|
|
207
|
+
"type": "string"
|
|
208
|
+
},
|
|
209
|
+
"content": {
|
|
210
|
+
"description": "JavaScript to be injected into the frame.",
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
"type": {
|
|
214
|
+
"description": "Sets the `type` of the script. Use `module` in order to load an ES2015 module.",
|
|
215
|
+
"type": "string"
|
|
216
|
+
},
|
|
217
|
+
"id": {
|
|
218
|
+
"description": "Sets the `id` of the script.",
|
|
219
|
+
"type": "string"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"additionalProperties": false
|
|
223
|
+
},
|
|
224
|
+
"FrameAddStyleTagOptions": {
|
|
225
|
+
"type": "object",
|
|
226
|
+
"properties": {
|
|
227
|
+
"url": {
|
|
228
|
+
"description": "the URL of the CSS file to be added.",
|
|
229
|
+
"type": "string"
|
|
230
|
+
},
|
|
231
|
+
"path": {
|
|
232
|
+
"description": "The path to a CSS file to be injected into the frame.",
|
|
233
|
+
"type": "string"
|
|
234
|
+
},
|
|
235
|
+
"content": {
|
|
236
|
+
"description": "Raw CSS content to be injected into the frame.",
|
|
237
|
+
"type": "string"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"additionalProperties": false
|
|
241
|
+
},
|
|
242
|
+
"Credentials": {
|
|
243
|
+
"type": "object",
|
|
244
|
+
"properties": {
|
|
245
|
+
"username": {
|
|
246
|
+
"type": "string"
|
|
247
|
+
},
|
|
248
|
+
"password": {
|
|
249
|
+
"type": "string"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"additionalProperties": false,
|
|
253
|
+
"required": [
|
|
254
|
+
"password",
|
|
255
|
+
"username"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
"CookieParam": {
|
|
259
|
+
"description": "Cookie parameter object used to set cookies in the page-level cookies\nAPI.",
|
|
260
|
+
"type": "object",
|
|
261
|
+
"properties": {
|
|
262
|
+
"name": {
|
|
263
|
+
"description": "Cookie name.",
|
|
264
|
+
"type": "string"
|
|
265
|
+
},
|
|
266
|
+
"value": {
|
|
267
|
+
"description": "Cookie value.",
|
|
268
|
+
"type": "string"
|
|
269
|
+
},
|
|
270
|
+
"url": {
|
|
271
|
+
"description": "The request-URI to associate with the setting of the cookie. This value can affect\nthe default domain, path, and source scheme values of the created cookie.",
|
|
272
|
+
"type": "string"
|
|
273
|
+
},
|
|
274
|
+
"domain": {
|
|
275
|
+
"description": "Cookie domain.",
|
|
276
|
+
"type": "string"
|
|
277
|
+
},
|
|
278
|
+
"path": {
|
|
279
|
+
"description": "Cookie path.",
|
|
280
|
+
"type": "string"
|
|
281
|
+
},
|
|
282
|
+
"secure": {
|
|
283
|
+
"description": "True if cookie is secure.",
|
|
284
|
+
"type": "boolean"
|
|
285
|
+
},
|
|
286
|
+
"httpOnly": {
|
|
287
|
+
"description": "True if cookie is http-only.",
|
|
288
|
+
"type": "boolean"
|
|
289
|
+
},
|
|
290
|
+
"sameSite": {
|
|
291
|
+
"description": "Cookie SameSite type.",
|
|
292
|
+
"enum": [
|
|
293
|
+
"Lax",
|
|
294
|
+
"None",
|
|
295
|
+
"Strict"
|
|
296
|
+
],
|
|
297
|
+
"type": "string"
|
|
298
|
+
},
|
|
299
|
+
"expires": {
|
|
300
|
+
"description": "Cookie expiration date, session cookie if not set",
|
|
301
|
+
"type": "number"
|
|
302
|
+
},
|
|
303
|
+
"priority": {
|
|
304
|
+
"description": "Cookie Priority. Supported only in Chrome.",
|
|
305
|
+
"enum": [
|
|
306
|
+
"High",
|
|
307
|
+
"Low",
|
|
308
|
+
"Medium"
|
|
309
|
+
],
|
|
310
|
+
"type": "string"
|
|
311
|
+
},
|
|
312
|
+
"sameParty": {
|
|
313
|
+
"description": "True if cookie is SameParty. Supported only in Chrome.",
|
|
314
|
+
"type": "boolean"
|
|
315
|
+
},
|
|
316
|
+
"sourceScheme": {
|
|
317
|
+
"description": "Cookie source scheme type. Supported only in Chrome.",
|
|
318
|
+
"enum": [
|
|
319
|
+
"NonSecure",
|
|
320
|
+
"Secure",
|
|
321
|
+
"Unset"
|
|
322
|
+
],
|
|
323
|
+
"type": "string"
|
|
324
|
+
},
|
|
325
|
+
"partitionKey": {
|
|
326
|
+
"description": "Cookie partition key. In Chrome, it matches the top-level site the\npartitioned cookie is available in. In Firefox, it matches the\nsource origin\n(https://w3c.github.io/webdriver-bidi/#type-storage-PartitionKey).",
|
|
327
|
+
"anyOf": [
|
|
328
|
+
{
|
|
329
|
+
"$ref": "#/definitions/CookiePartitionKey"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"type": "string"
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"additionalProperties": false,
|
|
338
|
+
"required": [
|
|
339
|
+
"name",
|
|
340
|
+
"value"
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
"CookiePartitionKey": {
|
|
344
|
+
"description": "Represents a cookie partition key in Chrome.",
|
|
345
|
+
"type": "object",
|
|
346
|
+
"properties": {
|
|
347
|
+
"sourceOrigin": {
|
|
348
|
+
"description": "The site of the top-level URL the browser was visiting at the start of the request\nto the endpoint that set the cookie.\n\nIn Chrome, maps to the CDP's `topLevelSite` partition key.",
|
|
349
|
+
"type": "string"
|
|
350
|
+
},
|
|
351
|
+
"hasCrossSiteAncestor": {
|
|
352
|
+
"description": "Indicates if the cookie has any ancestors that are cross-site to\nthe topLevelSite.\n\nSupported only in Chrome.",
|
|
353
|
+
"type": "boolean"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"additionalProperties": false,
|
|
357
|
+
"required": [
|
|
358
|
+
"sourceOrigin"
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
"ScrapeDebugOptions": {
|
|
362
|
+
"type": "object",
|
|
363
|
+
"properties": {
|
|
364
|
+
"console": {
|
|
365
|
+
"type": "boolean"
|
|
366
|
+
},
|
|
367
|
+
"cookies": {
|
|
368
|
+
"type": "boolean"
|
|
369
|
+
},
|
|
370
|
+
"html": {
|
|
371
|
+
"type": "boolean"
|
|
372
|
+
},
|
|
373
|
+
"network": {
|
|
374
|
+
"type": "boolean"
|
|
375
|
+
},
|
|
376
|
+
"screenshot": {
|
|
377
|
+
"type": "boolean"
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
"additionalProperties": false
|
|
381
|
+
},
|
|
382
|
+
"ScrapeElementSelector": {
|
|
383
|
+
"type": "object",
|
|
384
|
+
"properties": {
|
|
385
|
+
"selector": {
|
|
386
|
+
"type": "string"
|
|
387
|
+
},
|
|
388
|
+
"timeout": {
|
|
389
|
+
"type": "number"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"additionalProperties": false,
|
|
393
|
+
"required": [
|
|
394
|
+
"selector"
|
|
395
|
+
]
|
|
396
|
+
},
|
|
397
|
+
"GoToOptions": {
|
|
398
|
+
"type": "object",
|
|
399
|
+
"properties": {
|
|
400
|
+
"referer": {
|
|
401
|
+
"description": "If provided, it will take preference over the referer header value set by\n{@link Page.setExtraHTTPHeaderspage.setExtraHTTPHeaders()}.",
|
|
402
|
+
"type": "string"
|
|
403
|
+
},
|
|
404
|
+
"referrerPolicy": {
|
|
405
|
+
"description": "If provided, it will take preference over the referer-policy header value\nset by {@link Page.setExtraHTTPHeaderspage.setExtraHTTPHeaders()}.",
|
|
406
|
+
"type": "string"
|
|
407
|
+
},
|
|
408
|
+
"timeout": {
|
|
409
|
+
"description": "Maximum wait time in milliseconds. Pass 0 to disable the timeout.\n\nThe default value can be changed by using the\n{@link Page.setDefaultTimeout} or {@link Page.setDefaultNavigationTimeout}\nmethods.",
|
|
410
|
+
"type": "number"
|
|
411
|
+
},
|
|
412
|
+
"waitUntil": {
|
|
413
|
+
"description": "When to consider waiting succeeds. Given an array of event strings, waiting\nis considered to be successful after all events have been fired.",
|
|
414
|
+
"anyOf": [
|
|
415
|
+
{
|
|
416
|
+
"type": "array",
|
|
417
|
+
"items": {
|
|
418
|
+
"$ref": "#/definitions/PuppeteerLifeCycleEvent"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"enum": [
|
|
423
|
+
"domcontentloaded",
|
|
424
|
+
"load",
|
|
425
|
+
"networkidle0",
|
|
426
|
+
"networkidle2"
|
|
427
|
+
],
|
|
428
|
+
"type": "string"
|
|
429
|
+
}
|
|
430
|
+
]
|
|
431
|
+
},
|
|
432
|
+
"signal": {
|
|
433
|
+
"description": "A signal object that allows you to cancel the call.",
|
|
434
|
+
"$ref": "#/definitions/AbortSignal"
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"additionalProperties": false
|
|
438
|
+
},
|
|
439
|
+
"PuppeteerLifeCycleEvent": {
|
|
440
|
+
"enum": [
|
|
441
|
+
"domcontentloaded",
|
|
442
|
+
"load",
|
|
443
|
+
"networkidle0",
|
|
444
|
+
"networkidle2"
|
|
445
|
+
],
|
|
446
|
+
"type": "string"
|
|
447
|
+
},
|
|
448
|
+
"AbortSignal": {
|
|
449
|
+
"type": "object",
|
|
450
|
+
"properties": {
|
|
451
|
+
"aborted": {
|
|
452
|
+
"type": "boolean"
|
|
453
|
+
},
|
|
454
|
+
"onabort": {
|
|
455
|
+
"anyOf": [
|
|
456
|
+
{
|
|
457
|
+
"type": "object",
|
|
458
|
+
"additionalProperties": false
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"type": "null"
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
"reason": {}
|
|
466
|
+
},
|
|
467
|
+
"additionalProperties": false,
|
|
468
|
+
"required": [
|
|
469
|
+
"aborted",
|
|
470
|
+
"onabort",
|
|
471
|
+
"reason"
|
|
472
|
+
]
|
|
473
|
+
},
|
|
474
|
+
"Partial<ResponseForRequest>": {
|
|
475
|
+
"type": "object",
|
|
476
|
+
"properties": {
|
|
477
|
+
"status": {
|
|
478
|
+
"type": "number"
|
|
479
|
+
},
|
|
480
|
+
"headers": {
|
|
481
|
+
"description": "Optional response headers.\n\nThe record values will be converted to string following:\nArrays' values will be mapped to String\n(Used when you need multiple headers with the same name).\nNon-arrays will be converted to String.",
|
|
482
|
+
"$ref": "#/definitions/Record<string,unknown>"
|
|
483
|
+
},
|
|
484
|
+
"contentType": {
|
|
485
|
+
"type": "string"
|
|
486
|
+
},
|
|
487
|
+
"body": {
|
|
488
|
+
"anyOf": [
|
|
489
|
+
{
|
|
490
|
+
"type": "object",
|
|
491
|
+
"additionalProperties": false,
|
|
492
|
+
"patternProperties": {
|
|
493
|
+
"^[0-9]+$": {
|
|
494
|
+
"type": "number"
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
"properties": {
|
|
498
|
+
"BYTES_PER_ELEMENT": {
|
|
499
|
+
"type": "number"
|
|
500
|
+
},
|
|
501
|
+
"buffer": {
|
|
502
|
+
"$ref": "#/definitions/ArrayBufferLike"
|
|
503
|
+
},
|
|
504
|
+
"byteLength": {
|
|
505
|
+
"type": "number"
|
|
506
|
+
},
|
|
507
|
+
"byteOffset": {
|
|
508
|
+
"type": "number"
|
|
509
|
+
},
|
|
510
|
+
"length": {
|
|
511
|
+
"type": "number"
|
|
512
|
+
},
|
|
513
|
+
"__@toStringTag@389787": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"const": "Uint8Array"
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
"required": [
|
|
519
|
+
"BYTES_PER_ELEMENT",
|
|
520
|
+
"__@toStringTag@389787",
|
|
521
|
+
"buffer",
|
|
522
|
+
"byteLength",
|
|
523
|
+
"byteOffset",
|
|
524
|
+
"length"
|
|
525
|
+
]
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"type": "string"
|
|
529
|
+
}
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
"additionalProperties": false
|
|
534
|
+
},
|
|
535
|
+
"Record<string,unknown>": {
|
|
536
|
+
"type": "object",
|
|
537
|
+
"additionalProperties": false
|
|
538
|
+
},
|
|
539
|
+
"ArrayBufferLike": {
|
|
540
|
+
"anyOf": [
|
|
541
|
+
{
|
|
542
|
+
"$ref": "#/definitions/ArrayBuffer"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"$ref": "#/definitions/SharedArrayBuffer"
|
|
546
|
+
}
|
|
547
|
+
]
|
|
548
|
+
},
|
|
549
|
+
"ArrayBuffer": {
|
|
550
|
+
"type": "object",
|
|
551
|
+
"properties": {
|
|
552
|
+
"byteLength": {
|
|
553
|
+
"type": "number"
|
|
554
|
+
},
|
|
555
|
+
"__@toStringTag@389787": {
|
|
556
|
+
"type": "string"
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
"additionalProperties": false,
|
|
560
|
+
"required": [
|
|
561
|
+
"__@toStringTag@389787",
|
|
562
|
+
"byteLength"
|
|
563
|
+
]
|
|
564
|
+
},
|
|
565
|
+
"SharedArrayBuffer": {
|
|
566
|
+
"type": "object",
|
|
567
|
+
"properties": {
|
|
568
|
+
"byteLength": {
|
|
569
|
+
"type": "number"
|
|
570
|
+
},
|
|
571
|
+
"__@species@389825": {
|
|
572
|
+
"$ref": "#/definitions/SharedArrayBuffer"
|
|
573
|
+
},
|
|
574
|
+
"__@toStringTag@389787": {
|
|
575
|
+
"type": "string",
|
|
576
|
+
"const": "SharedArrayBuffer"
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
"additionalProperties": false,
|
|
580
|
+
"required": [
|
|
581
|
+
"__@species@389825",
|
|
582
|
+
"__@toStringTag@389787",
|
|
583
|
+
"byteLength"
|
|
584
|
+
]
|
|
585
|
+
},
|
|
586
|
+
"Record<string,string>": {
|
|
587
|
+
"type": "object",
|
|
588
|
+
"additionalProperties": false
|
|
589
|
+
},
|
|
590
|
+
"Viewport": {
|
|
591
|
+
"type": "object",
|
|
592
|
+
"properties": {
|
|
593
|
+
"width": {
|
|
594
|
+
"description": "The page width in CSS pixels.",
|
|
595
|
+
"type": "number"
|
|
596
|
+
},
|
|
597
|
+
"height": {
|
|
598
|
+
"description": "The page height in CSS pixels.",
|
|
599
|
+
"type": "number"
|
|
600
|
+
},
|
|
601
|
+
"deviceScaleFactor": {
|
|
602
|
+
"description": "Specify device scale factor.\nSee {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio devicePixelRatio} for more info.",
|
|
603
|
+
"type": "number"
|
|
604
|
+
},
|
|
605
|
+
"isMobile": {
|
|
606
|
+
"description": "Whether the `meta viewport` tag is taken into account.",
|
|
607
|
+
"type": "boolean"
|
|
608
|
+
},
|
|
609
|
+
"isLandscape": {
|
|
610
|
+
"description": "Specifies if the viewport is in landscape mode.",
|
|
611
|
+
"type": "boolean"
|
|
612
|
+
},
|
|
613
|
+
"hasTouch": {
|
|
614
|
+
"description": "Specify if the viewport supports touch events.",
|
|
615
|
+
"type": "boolean"
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
"additionalProperties": false,
|
|
619
|
+
"required": [
|
|
620
|
+
"height",
|
|
621
|
+
"width"
|
|
622
|
+
]
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
626
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EdgeCDP, HTTPRoutes } from '@browserless.io/browserless';
|
|
2
|
+
import { BodySchema, QuerySchema, ResponseSchema, default as Scrape } from '../../../shared/scrape.http.js';
|
|
3
|
+
export default class EdgeScrapePostRoute extends Scrape {
|
|
4
|
+
name: string;
|
|
5
|
+
browser: typeof EdgeCDP;
|
|
6
|
+
path: HTTPRoutes[];
|
|
7
|
+
}
|
|
8
|
+
export { BodySchema, QuerySchema, ResponseSchema };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BrowserlessRoutes, EdgeCDP, HTTPRoutes, } from '@browserless.io/browserless';
|
|
2
|
+
import { default as Scrape, } from '../../../shared/scrape.http.js';
|
|
3
|
+
export default class EdgeScrapePostRoute extends Scrape {
|
|
4
|
+
name = BrowserlessRoutes.EdgeScrapePostRoute;
|
|
5
|
+
browser = EdgeCDP;
|
|
6
|
+
path = [HTTPRoutes.edgeScrape];
|
|
7
|
+
}
|