Reputation: 45494
Is there any way to pass a reference to a page in Puppeteer? Or is it limited only to serializable data?
For example, I'm imagining doing page.exposeFunction('require', ...)
to begin making my own Electron, but that won't work if we can only return serializable data.
Upvotes: 0
Views: 192
Reputation: 29037
Puppeteer provides an API to control Chromium over the DevTools Protocol, which means that the Page class utilizes the Page Domain from the Chrome DevTools Protocol.
The return values obtained from the Page domain are all serializable.
Therefore, it appears that you are limited only to serializable data.
Upvotes: 1