These are chat archives for rosshinkley/nightmare

28th
Jul 2016
Ash Nilkanth
@voidmonk
Jul 28 2016 04:04 UTC
Hey guys! Anyone around to answer a few questions?
Ross Hinkley
@rosshinkley
Jul 28 2016 05:06 UTC
shoot, my brain is about scrambled though :P
Ash Nilkanth
@voidmonk
Jul 28 2016 05:12 UTC
Thanks. Is it possible to set auto-redirection (and max redirects) through Nightmare or Electron?
i.e. enable/disable auto-redirection, and if enabled set max number of redirects possible before the request is terminated
Ross Hinkley
@rosshinkley
Jul 28 2016 05:17 UTC
good question... off the top of my head, i'm not sure
you could probably set up nightmare to cancel the request on 30x...
although now that i'm thinking about it, i don't think there's a super-clean way to stop a .goto() that's in progress
i assume you want to make the max redirects something small?
(i think the default is 20ish)
Ross Hinkley
@rosshinkley
Jul 28 2016 05:24 UTC
a cursory look at the chrome switches didn't yield anything
aaaand github is down
... i'll take a look at electron tomorrow
and if that doesn't turn up anything, i'll take a stroll through the chromium source to see if anything jumps out
Ash Nilkanth
@voidmonk
Jul 28 2016 05:26 UTC
cool, thanks
Based on my quick test, Electron does handle redirects (HTTP 301, 302 etc, or client-side JS), but I'm not sure what's the max redirects limit and how to reduce it for a quick turnaround.
Secondly, I assume that Electron accepts cookies, but do those cookies persist across Nightmare instances and page requests?
Ross Hinkley
@rosshinkley
Jul 28 2016 05:30 UTC
it'll handle redirects just fine
it should behave similarly to chrome
i am almost positive the max redirect limit is ~20
and yes, electron handles cookies
persisting across instances... is tricky, but out of the box, i think the answer is yes, memory serving
Ash Nilkanth
@voidmonk
Jul 28 2016 05:38 UTC
ok, anyway to disable/restrict cookie persistence, but still accept cookies for a page?
Ash Nilkanth
@voidmonk
Jul 28 2016 08:54 UTC
I'll appreciate if someone can shed some light on this other issue I encountered: Error on 'wait' after 'goto' status code check - segmentio/nightmare#737
Michael Bodnarchuk
@DavertMik
Jul 28 2016 09:33 UTC
Yesterday I released CodeceptJS testing framework with Nightmare support.
It provides unified API for Selenium and Nightmare tests and much more.
Check it out http://codecept.io/nightmare/
Arne Bahlo
@bahlo
Jul 28 2016 10:14 UTC
Hey guys, how can I access electron.webFrame from nightmare.child.call? (https://github.com/electron/electron/blob/4dc8e905865310ebf091ab994dd78a6b13512e2d/docs/api/web-frame.md)
Ross Hinkley
@rosshinkley
Jul 28 2016 13:36 UTC
@voidmonk i think webPreferences.partition is what you're after
i'll also have a look at that issue later today
@bahlo hm, .action() has an ambient reference to Electron's require for the Electron-side function
could you require Electron and pull the webframe out there?
@DavertMik I'll have to check it out :) thanks for the update
ErraticFox
@ErraticFox
Jul 28 2016 17:04 UTC
Does nightmare eval js too?
Ross Hinkley
@rosshinkley
Jul 28 2016 18:11 UTC
@ErraticFox what do you mean?