GithubHelp home page GithubHelp logo

node-headless's People

Contributors

amilajack avatar gbaudusseau avatar jfhbrook avatar juliangruber avatar kapouer avatar kesla avatar twolfson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-headless's Issues

Get Display Info from spawned process

Hi,

I am using headless and am new to node, how can i get the spawned information from returned childprocess like display resolution, size etc just to make sure it gives the desirable result and also for debugging purposes.

Pass arbitrary arguments to Xvfb?

Hey guys,

This is a great package! I'm currently seeing an error in the electron-eval project, which depends on this. StackOverflow seems to think that this can be solved by adding some CLI args to Xvfb, although I'm not sure which ones exactly. Could I make a PR that allows the user to specify custom CLI args for Xvfb? Does anyone have an opinion on the interface?

Running inside X Virtual Frame Buffer

I have to nightmare script inside xvfb.

xvfb-run node cnn.js

cnn.js has....

var Nightmare = require('../nightmare');
var vo = require('vo');

vo(run)(function(err, result) {
  if (err) throw err;
});

function *run() {
  var nightmare = Nightmare();
  var title = yield nightmare
    .goto('http://cnn.com')
    .evaluate(function() {
      return document.title;
    });
  console.log(title);
  yield nightmare.end();
}

is there a way to write the whole code inside X Virtual Frame Buffer, so that we can execute in normal way

node cnn.js instead of xvfb-run node cnn.js

Connect to spawned server

Pardon my ignorance. I can't figure out how to actually connect to the spawned server. I've been previously using (without nodejs) xvfb-run -a some-binary โ€“ how would I translate that to this library?

I've tried the following

var headless = require('headless'),
var exec = require('child_process').exec;

headless(function(err, childProcess, servernum) {
    exec('xvfb-run -n '+ servernum + ' some-binary', error, stdout, stderr) {
        console.log('stdout:', stdout);
        console.log('stderr:', stderr);

        // kill the xvfb server - is this the correct place to do this?
        childProcess.kill();
    });
});

But this only emits "error: Xvfb failed to start", as if servernum were invalid.

Travis CI failing on OSX

I added a stdio option (#22) that shows that the failures are as below. I actually got the same error on my laptop, and I was able to fix it manually by following the instructions from the first comment in this issue for the Ruby version of headless.

> [email protected] test /Users/travis/build/paulkernfeld/node-headless
> node test/test.js
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
/Users/travis/build/paulkernfeld/node-headless/test/test.js:5
  throw new Error('Timeout 2 seconds. You don\'t have xvfb installed or someth
        ^
Error: Timeout 2 seconds. You don't have xvfb installed or something else is seriously wrong.
    at options.display.width [as _onTimeout] (/Users/travis/build/paulkernfeld/node-headless/test/test.js:5:9)
    at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
npm ERR! Test failed.  See above for more details.

How to run with nightmarejs ?

Hi,
how to use it with nightmarejs ?
Should i do :

headless(options, (err, childProcess, servernum) =>{
        // childProcess is a ChildProcess, as returned from child_process.spawn()
        console.log('Xvfb running on server number', servernum);
        console.log('Xvfb pid', childProcess.pid);
        console.log('err should be null', err);

        const nightmare = new Nightmare({
            //show: true,
            webPreferences: {
                partition: 'nopersist'
            }
        });
        console.log('nightmare started')
        nightmare.goto('http://www.google.fr')
       // ..... other instruction....
});

Nightmare seems to start but nothing happen after...

Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.