Skip to content

Commit

Permalink
[UPD] built-in phantomjs
Browse files Browse the repository at this point in the history
  • Loading branch information
fouber committed May 18, 2015
1 parent d4f80df commit e5a7018
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
test/
test/
node_modules
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var PHANTOMJS_SCRIPT_DIR = path.join(__dirname, 'phantomjs');
var PHANTOMJS_SCRIPT_FILE = path.join(PHANTOMJS_SCRIPT_DIR, 'index.js');
var _ = require('./util.js');
var _exists = fs.existsSync || path.existsSync;
var phantomjs = require('phantomjs');
var binPath = phantomjs.path;

/**
* mkdir -p
Expand Down Expand Up @@ -413,7 +415,7 @@ Monitor.prototype._phantom = function(args, callback){
});
this.emit('debug', 'cli arguments: ' + JSON.stringify(arr));
arr = arr.concat(args);
var proc = spawn('phantomjs', arr);
var proc = spawn(binPath, arr);
proc.stdout.on('data', this._parseLog.bind(this));
proc.stderr.on('data', this._parseLog.bind(this));
proc.on('exit', function(code){
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "page-monitor",
"version": "0.4.7",
"version": "0.4.8",
"description": "monitor pages and diff the dom change with phantomjs",
"main": "index.js",
"scripts": {
Expand All @@ -12,6 +12,9 @@
"phantom",
"diff"
],
"dependencies": {
"phantomjs": "~1.9.16"
},
"repository": {
"type": "git",
"url": "https://github.com/fouber/page-monitor.git"
Expand Down
3 changes: 2 additions & 1 deletion phantomjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ M.prototype.highlight = function(left, right, diff, callback){
var opt = {
page : {
settings: {
localToRemoteUrlAccessEnabled: true
localToRemoteUrlAccessEnabled: true,
webSecurityEnabled: false
}
},
render: {
Expand Down

0 comments on commit e5a7018

Please sign in to comment.