We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Server Side rendering (Puppeteer)

Home Forums Programming Server Side rendering (Puppeteer)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #61359
    junglist
    Customer

    Hello everyone,

    I’m trying to generate screenshot of configurator.
    So far I have made model responsive to postmessage(“some_code”).

    I was wondering is it possible to postMessage() while Puppeteer is generating screenshot. So I would get a configuration I need in the screenshot.

    #61370

    Hi,
    you can either set some variable, say v3d.app_ready_for_screenshot or so or use event mechanism to report about the readiness. In the puppeteer code you can just wait for this variable/event in the setInterval() loop, then take a screenshot.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #61377
    junglist
    Customer

    Thank you,

    I got it solved by adding:

    ******

    .option(‘-m, –message [message]’, ‘The message to send to the page’)

    ******

    console.log(‘Sending post message to page…’);
    await page.evaluate((message) => {
    window.postMessage(message, ‘*’);
    }, opts.message);

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.