Add experimental support for slimerjs.

Pass the --slimerjs flag to run yslow in slimerjs instead of phantomjs.
Closes #544
This commit is contained in:
Tobias Lidskog 2014-12-16 00:56:58 +01:00
parent 442d761c97
commit da5509ae22
4 changed files with 17 additions and 2 deletions

View File

@ -2,6 +2,7 @@ CHANGELOG sitespeed.io
version 3.0.1
------------------------
* Add experimental support for running yslow in [SlimerJS](http://www.slimerjs.org) #544
version 3.0.0
------------------------

View File

@ -6,7 +6,8 @@
*/
var path = require('path'),
childProcess = require('child_process'),
binPath = require('phantomjs').path,
phantomPath = require('phantomjs').path,
slimerPath = require('slimerjs').path,
util = require('../util/util'),
fs = require('fs'),
winston = require('winston'),
@ -64,8 +65,16 @@ function analyzeUrl(args, asyncDoneCallback) {
var config = args.config;
var log = winston.loggers.get('sitespeed.io');
var binPath = phantomPath;
// PhantomJS arguments
var childArgs = ['--ssl-protocol=any', '--ignore-ssl-errors=yes'];
var childArgs = [];
if (args.slimerjs) {
binPath = slimerPath;
} else {
childArgs.push('--ssl-protocol=any', '--ignore-ssl-errors=yes');
}
if (config.proxy) {
childArgs.push('--proxy', config.urlProxyObject.host, '--proxy-type',

View File

@ -151,6 +151,10 @@ var fs = require('fs-extra'),
}
}
},
slimerjs: {
flag: true,
help: 'Use Slimerjs instead of Phantomjs for yslow processing (Experimental).'
},
ruleSet: {
metavar: '<RULE-SET>',
default: defaultConfig.ruleSet,

View File

@ -44,6 +44,7 @@
"dependencies": {
"handlebars": "2.0.x",
"phantomjs": "1.9.x",
"slimerjs": "0.9.x",
"async": "0.9.x",
"fast-stats": "0.0.2",
"fs-extra": "0.13.x",