html-get 2.24.0 → 2.24.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 +5 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "html-get",
|
|
3
3
|
"description": "Get the HTML from any website, fine-tuned for correction & speed",
|
|
4
4
|
"homepage": "https://nicedoc.com/microlinkhq/html-get",
|
|
5
|
-
"version": "2.24.
|
|
5
|
+
"version": "2.24.1",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"bin": {
|
package/src/index.js
CHANGED
|
@@ -316,7 +316,9 @@ module.exports = PCancelable.fn(
|
|
|
316
316
|
|
|
317
317
|
let { mode, html, $, ...payload } = await promise
|
|
318
318
|
|
|
319
|
-
|
|
319
|
+
let shadowDOM = hasShadowDOM($)
|
|
320
|
+
|
|
321
|
+
if (mode === 'fetch' && getBrowserless && shadowDOM) {
|
|
320
322
|
debug('shadow DOM detected, retrying with prerender', { url: targetUrl })
|
|
321
323
|
const prerenderPromise = getContent(targetUrl, 'prerender', {
|
|
322
324
|
getBrowserless,
|
|
@@ -331,11 +333,12 @@ module.exports = PCancelable.fn(
|
|
|
331
333
|
})
|
|
332
334
|
onCancel(() => prerenderPromise.cancel())
|
|
333
335
|
;({ mode, html, $, ...payload } = await prerenderPromise)
|
|
336
|
+
shadowDOM = hasShadowDOM($)
|
|
334
337
|
}
|
|
335
338
|
|
|
336
339
|
return Object.assign(payload, {
|
|
337
340
|
...serializeHtml($),
|
|
338
|
-
stats: { mode, timing: duration() }
|
|
341
|
+
stats: { mode, timing: duration(), shadowDOM }
|
|
339
342
|
})
|
|
340
343
|
}
|
|
341
344
|
)
|