These are chat archives for rosshinkley/nightmare

21st
Jul 2016
Ross Hinkley
@rosshinkley
Jul 21 2016 00:45
@gebidesign no problem, and yyyyes
you should be able to define a custom preload (best bet is to copy the stock one)
specifically this:
   // overwrite the default confirm
  window.confirm = function(message, defaultResponse){
    __nightmare.ipc.send('page', 'confirm', message, defaultResponse);
  }
... although now that i'm thinking about it, i'm pretty sure the default response is 'ok'
if that's not the behavior you're seeing, let me know
@mingsterism yes, you still have to use xvfb for the moment
i know headless chrome is coming, but i haven't checked up on the progress, or how it's being ported to chromium
... and now that i think about that, i might have it backwards
i can't remember right now :P
(someone else here is bound to know more about that than i do)
Ross Hinkley
@rosshinkley
Jul 21 2016 00:50
are you having trouble, and if so, what's going on?
Mingsterism
@mingsterism
Jul 21 2016 00:51
well. naturally i want to run nightmare on cloud linux server
so realised that needed the xvfb option.
i followed the tips in the nightmare issue 224. works fine based on initial testing so far (like 10 mins). dont know how reliable it will be if leave it running for couple hours.
just want to understand, is xvfb like a bad hack for headless?
Ross Hinkley
@rosshinkley
Jul 21 2016 00:53
it should be fine
and no, xvfb is a virtual frame buffer (the vfb part) for X
it gives windows that would normally be spawned under x something to render on
there are... edge cases with using xvfb
but
.. well, i should probably ask, given that i'm pretty sure you're writing some sort of fancy crawler/scraper: are you going to be creating and destroying a bunch of nightmare instances?
(a bunch meaning somewhere in the hundreds as fast as possible)
Mingsterism
@mingsterism
Jul 21 2016 00:58
ah. nothing fancy actually. just basic single site crawlers for now.
well, i do want to launch multiple in the future
as many as possible. however u mentioned last time per server around a dozen or so nightmare instances. due to heavy resource usage
im just exploring the possibilities with nightmare. xvfb should be less resource intensive right?
Ross Hinkley
@rosshinkley
Jul 21 2016 00:59
simultaneously
yes
Mingsterism
@mingsterism
Jul 21 2016 00:59
also, whats the real benefits of headless chrome if xvfb works fine?
Ross Hinkley
@rosshinkley
Jul 21 2016 00:59
uh, less resource intensive... yyyyes?
i'm not actually sure
i suspect xvfb is cheaper than x11 et al
but i don't have any real evidence :P
the real benefits of headless chrome: less dependencies
fewer screwy things that can happen with x and the associated message bus
it reduces the number of failure points quite a bit, and if i could be incredibly selfish, would really simplify the nightmare test suite :P
Mingsterism
@mingsterism
Jul 21 2016 01:02
i see. is this project open source? who would be developing it?
Ross Hinkley
@rosshinkley
Jul 21 2016 01:03
"this project" meaning...
Mingsterism
@mingsterism
Jul 21 2016 01:03
headless chrome
Ross Hinkley
@rosshinkley
Jul 21 2016 01:03
chrome itself isn't, but chromium (what electron is built off of) is
i suspect it'll be ported over?
i'm not sure what the roadmap is
Mingsterism
@mingsterism
Jul 21 2016 01:05
i see.
btw is this the relevant headless chrome link?
Ross Hinkley
@rosshinkley
Jul 21 2016 01:06
looks that way
electron/electron#228
also related
Mingsterism
@mingsterism
Jul 21 2016 01:08
ah nice.
will check those out.
thanks Ross :)
Ross Hinkley
@rosshinkley
Jul 21 2016 01:09
anytime
not sure i gave you great answers :P
at any rate, if you have trouble with xvfb, let me know
Mingsterism
@mingsterism
Jul 21 2016 01:11
thanks. no it was good. just wanted some better understanding.
sure thing.