event: ‘close’

    • <>

    Emitted when this dedicated WebWorker is terminated.

    worker.evaluate(pageFunction[, arg])

    • arg <Serializable|> Optional argument to pass to pageFunction
    • returns: <Promise<>> Promise which resolves to the return value of pageFunction

    If the function passed to the returns a non-Serializable value, then worker.evaluate resolves to undefined. DevTools Protocol also supports transferring some additional values that are not serializable by JSON: -0, NaN, Infinity, -Infinity, and bigint literals.

    worker.evaluateHandle(pageFunction[, arg])

    • <function|> Function to be evaluated in the page context
    • arg <Serializable|> Optional argument to pass to pageFunction

    If the function passed to the worker.evaluateHandle returns a Promise, then would wait for the promise to resolve and return its value.

    worker.url()