Open sxiii opened 4 years ago
browser.newPage()
cause error
UnhandledPromiseRejectionWarning: Error: Protocol error (Target.createTarget): Not supported
Because electron do not support multi-tab view
page.pdf
cause error
UnhandledPromiseRejectionWarning: Error: Protocol error (Page.printToPDF): PrintToPDF is not implemented
Because "Puppeteer Docs" say https://github.com/puppeteer/puppeteer/blob/v2.1.0/docs/api.md#pagepdfoptions
NOTE Generating a pdf is currently only supported in Chrome headless.
It is not possible for puppeteer-core but possible for electron https://github.com/electron/electron/blob/master/docs/api/web-contents.md#contentsprinttopdfoptions
I can make a proxy for page.pdf
to call contents.printToPDF
in the future
Now you can directly use electron-pdf (https://github.com/fraserxu/electron-pdf)
Oh I just realized electron requires the "xvfb" package which does not exist (and probably won't) for my distro. So I probably will have to stick to chromium/chrome binaries for screenshots as they work in headless without the xvfb. But thanks for debug @nondanee
Is it possible to make screenshots with electron? Here's what I've tried (index.js):
In the result; it runs but does nothing.