JSDOM in cloudflare worker?


#1

Background
I would like to use the Cloudflare worker to get information from a single page application. I need the application to render javascript before can get this information.

Has anyone successfully managed to use a headless browser such as JSDOM in a cloudflare worker?
Is this something thats even possible at this time? Are there any examples out there?


#2

Parsing the DOM require too much CPU time.

See the benchmarks, they go over the 5ms of the free plan - you’d have to use a larger plan that gives you 20ms to be able to do this.


#3

Oh wow…Thanks for bringing that up. It appears that cloudflare worker will not work for my use case.


#4

Afaik, there is no complete DOM replacement, but you may try my adopted version of node-trumpet: