phantom-proxy
A set of proxy objects for driving phantomjs from node
Last updated 14 years ago by sheebz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install phantom-proxy 
SYNC missed versions from official npm registry.

phantom-proxy

Provides a proxy interface for phantomjs which runs inside of node. Now you can run phantom and access the full api from within nodejs.

Overview

PhantomJs is an incredibly useful tool for functional and unit testing. Problem is that it runs in its own process which is outside of node, so you are basically out of luck if you want to integrate with phantomjs from within node. There are some other libraries - phantom-node, node-phantom, that address the same problem.

Why do we need another nodejs runtime for phantom?

Phantom-proxy takes a different approach to communicating with phantom than these modules. Phantom-node passes messages using alerts and express. While this was an ingenious solution to a difficult problem at the time, better solutions are now available. As of version 1.4, phantomjs provides an embedded webserver called mongoose which can be used to pass messages. Phantom-proxy leverages this, which is the fastst and most reliable approach.

##Instalation npm install phantom-proxy

##usage

phantomProxy = require('phantom-proxy');
phantomProxy.createProxy({}, function (proxy) {
    proxy.page.onConsoleMessage = function (event) {
        console.log(JSON.stringify(event));
    };
    proxy.page.open('http://www.google.com', function () {
        proxy.page.waitForSelector('body', function () {
            proxy.page.render('./scratch/loginTest.png', function () {
                proxy.phantom.exit(function () {
                    console.log('test complete');
                });
            });
        });
    });
});

Current Tags

  • 0.1.792                                ...           latest (14 years ago)

42 Versions

  • 0.1.792                                ...           14 years ago
  • 0.1.791                                ...           14 years ago
  • 0.1.79                                ...           14 years ago
  • 0.1.78                                ...           14 years ago
  • 0.1.77                                ...           14 years ago
  • 0.1.76                                ...           14 years ago
  • 0.1.75                                ...           14 years ago
  • 0.1.74                                ...           14 years ago
  • 0.1.73                                ...           14 years ago
  • 0.1.721                                ...           14 years ago
  • 0.1.72                                ...           14 years ago
  • 0.1.71                                ...           14 years ago
  • 0.1.69                                ...           14 years ago
  • 0.1.68                                ...           14 years ago
  • 0.1.67                                ...           14 years ago
  • 0.1.66                                ...           14 years ago
  • 0.1.65                                ...           14 years ago
  • 0.1.64                                ...           14 years ago
  • 0.1.62                                ...           14 years ago
  • 0.1.61                                ...           14 years ago
  • 0.1.51                                ...           14 years ago
  • 0.1.2                                ...           14 years ago
  • 0.1.19                                ...           14 years ago
  • 0.1.18                                ...           14 years ago
  • 0.1.17                                ...           14 years ago
  • 0.1.16                                ...           14 years ago
  • 0.1.15                                ...           14 years ago
  • 0.1.14                                ...           14 years ago
  • 0.1.12                                ...           14 years ago
  • 0.1.10                                ...           14 years ago
  • 0.1.9                                ...           14 years ago
  • 0.1.8                                ...           14 years ago
  • 0.1.7                                ...           14 years ago
  • 0.1.6                                ...           14 years ago
  • 0.1.5                                ...           14 years ago
  • 0.1.4                                ...           14 years ago
  • 0.1.3                                ...           14 years ago
  • 0.1.1                                ...           14 years ago
  • 0.1.0                                ...           14 years ago
  • 0.0.3                                ...           14 years ago
  • 0.0.2                                ...           14 years ago
  • 0.0.1                                ...           14 years ago
Maintainers (1)
Downloads
Total 117
Today 0
This Week 0
This Month 55
Last Day 0
Last Week 0
Last Month 62
Dependencies (8)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE