These are chat archives for rosshinkley/nightmare

16th
May 2017
Ayana Wilson
@awilson28
May 16 2017 12:09
@johnferro hey, thanks for your help a few days ago; I've found a way to prevent the popups from loading and to load the data into the main/single window. Everything seems to go well until I receive a "Failed to Load PDF Document" Error. This is the last hurdle, assuming that Nightmare makes it easy to download the pdf and/or capture the content of the page. And ideas?
Rob Brackett
@Mr0grog
May 16 2017 15:33
@amrutharamesh In Nightmare’s main API, you can use any feature that works in the Node.js version you are using. In functions you pass to evaluate or wait, you can use anything that works in the version of Electron you are on. Nightmare has generally kept reasonably up-to-date with Electron and is usually ahead of Node.js as far as what ES features work. At this point, pretty much everything except import and export work in the latest stable of Node.js and Electron (and therefore Nightmare)
But if you are running Nightmare in Node.js 4, for example, a lot of things won't work.
Ayana Wilson
@awilson28
May 16 2017 16:47
@Mr0grog do you know if nightmare has issues loading pdfs?
Rob Brackett
@Mr0grog
May 16 2017 16:51
I don’t think I’ve ever tried that out, so no idea.
Ayana Wilson
@awilson28
May 16 2017 16:51
ok thanks
johnferro
@johnferro
May 16 2017 18:17
@awilson28 Couple of questions: Is the "Failed to Load PDF Document" error coming from nightmare/electron or from the site that you're accessing? Also are you trying to display the pdf or just download it? If the pdf needs to be displayed within electron then I think electron's Browser window doesn't support that. There are projects such as this which might. You could theoretically modify nightmare's electron runner to make a new pdf window from that library instead of a browser window. I haven't tried anything with pdf's before so definitely not 100% sure that will work, just a theory. If you just need to download the pdf then it might make the most sense to capture the pdf's url somehow and download it separately from nightmare.