JSDOMCrawler access features of JSDOM
I have set runScripts but I would like to access, resources: "usable", pretendToBeVisual, and maybe canvas. I have not been successful accessing those JSDOM options. Any ideas would be greatly appreciated.
2 Replies
I checked the implementation and it seems that, the:
- resources: Seems to be hardcoded https://github.com/apify/crawlee/blob/8ea7a4f3622ecdbba11f6dd7a6325d52f38ec603/packages/jsdom-crawler/src/internals/jsdom-crawler.ts#L143
- so overriding seems to not be possible, maybe some hacky overriding the class constructor before running the crawler :\
- pretendToBeVisual - is always set to be
true
( https://github.com/apify/crawlee/blob/8ea7a4f3622ecdbba11f6dd7a6325d52f38ec603/packages/jsdom-crawler/src/internals/jsdom-crawler.ts#L219 )
- canvas - As I understand from the description should be only about adding peerDependency
to the package.json
https://github.com/jsdom/jsdom#canvas-supportmanual-pinkOP•3y ago
Yeah with resources I came to the same conclusion. Thanks for taking a look. Trying test with just jsdom to see if it will even work out.