Socket
Socket
Sign inDemoInstall

grunt-lib-phantomjs

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-lib-phantomjs - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

5

lib/phantomjs.js

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors
* Copyright (c) 2013 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.

@@ -159,2 +159,4 @@ */

grunt.log.write('Running PhantomJS...').error();
// Print result to stderr because sometimes the 127 code means that a shared library is missing
String(result).split('\n').forEach(grunt.log.error, grunt.log);
if (code === 127) {

@@ -169,3 +171,2 @@ grunt.log.errorlns(

} else {
String(result).split('\n').forEach(grunt.log.error, grunt.log);
grunt.warn('PhantomJS exited unexpectedly with exit code ' + code + '.', failCode);

@@ -172,0 +173,0 @@ }

10

package.json
{
"name": "grunt-lib-phantomjs",
"description": "Grunt and PhantomJS, sitting in a tree.",
"version": "0.3.1",
"version": "0.4.0",
"homepage": "http://github.com/gruntjs/grunt-lib-phantomjs",

@@ -36,7 +36,11 @@ "author": {

"devDependencies": {
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-jshint": "~0.6.2",
"grunt": "~0.4.0",
"difflet": "~0.2.3"
},
"main": "lib/phantomjs"
"main": "lib/phantomjs",
"files": [
"lib",
"phantomjs"
]
}

@@ -90,3 +90,3 @@ /*

page.onResourceRequested = function(request) {
sendMessage('onResourceRequested', request.url);
sendMessage('onResourceRequested', request);
};

@@ -96,3 +96,3 @@

if (request.stage === 'end') {
sendMessage('onResourceReceived', request.url);
sendMessage('onResourceReceived', request);
}

@@ -123,2 +123,5 @@ };

page.onLoadFinished = function(status) {
// reset this handler to a no-op so further calls to onLoadFinished from iframes don't affect us
page.onLoadFinished = function() { /* no-op */}
// The window has loaded.

@@ -125,0 +128,0 @@ sendMessage('onLoadFinished', status);

@@ -7,5 +7,5 @@ # grunt-lib-phantomjs

The best way to understand how this lib should be used is by looking at the [grunt-contrib-qunit](https://github.com/gruntjs/grunt-contrib-qunit) plugin. Mainly, look at how [the lib is required](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L17), how [event handlers are bound](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L51-L128) and how [PhantomJS is actually spawned](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L160-L173).
The best way to understand how this lib should be used is by looking at the [grunt-contrib-qunit](https://github.com/gruntjs/grunt-contrib-qunit) plugin. Mainly, look at how [the lib is required](https://github.com/gruntjs/grunt-contrib-qunit/blob/d99291713d32f84e50303d6e51eb2dab40b1deb6/tasks/qunit.js#L17), how [event handlers are bound](https://github.com/gruntjs/grunt-contrib-qunit/blob/d99291713d32f84e50303d6e51eb2dab40b1deb6/tasks/qunit.js#L61-L144) and how [PhantomJS is actually spawned](https://github.com/gruntjs/grunt-contrib-qunit/blob/d99291713d32f84e50303d6e51eb2dab40b1deb6/tasks/qunit.js#L177-L190).
Also, in the case of the grunt-contrib-qunit plugin, it's important to know that the page being loaded into PhantomJS *doesn't* know it will be loaded into PhantomJS, and as such doesn't have any PhantomJS->Grunt code in it. That communication code, aka. the ["bridge"](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/phantomjs/bridge.js), is dynamically [injected into the html page](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L136).
Also, in the case of the grunt-contrib-qunit plugin, it's important to know that the page being loaded into PhantomJS *doesn't* know it will be loaded into PhantomJS, and as such doesn't have any PhantomJS->Grunt code in it. That communication code, aka. the ["bridge"](https://github.com/gruntjs/grunt-contrib-qunit/blob/d99291713d32f84e50303d6e51eb2dab40b1deb6/phantomjs/bridge.js), is dynamically [injected into the html page](https://github.com/gruntjs/grunt-contrib-qunit/blob/d99291713d32f84e50303d6e51eb2dab40b1deb6/tasks/qunit.js#L152).

@@ -100,6 +100,12 @@ ## An inline example

## OS Dependencies
PhantomJS requires these dependencies
**On Ubuntu/Debian**
apt-get install libfontconfig1 fontconfig libfontconfig1-dev libfreetype6-dev
## Release History
* 2013-08-02 - v0.4.0 - /34 /18 /24 merged
* 2013-02-28 - v0.3.0 - Use PhantomJS 1.9.0-1.
* 2013-02-28 - v0.2.0 - Use PhantomJS 1.8.1.
* 2012-12-21 - v0.1.0 - Use PhantomJS 1.7.0.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc