diff --git a/.gitignore b/.gitignore index 5a5900c..b5a5a59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -test/ \ No newline at end of file +test/ +node_modules \ No newline at end of file diff --git a/index.js b/index.js index 959bb36..a53c43d 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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){ diff --git a/package.json b/package.json index 62e66c9..ad4990a 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -12,6 +12,9 @@ "phantom", "diff" ], + "dependencies": { + "phantomjs": "~1.9.16" + }, "repository": { "type": "git", "url": "https://github.com/fouber/page-monitor.git" diff --git a/phantomjs/index.js b/phantomjs/index.js index 7b7905e..90506e2 100644 --- a/phantomjs/index.js +++ b/phantomjs/index.js @@ -328,7 +328,8 @@ M.prototype.highlight = function(left, right, diff, callback){ var opt = { page : { settings: { - localToRemoteUrlAccessEnabled: true + localToRemoteUrlAccessEnabled: true, + webSecurityEnabled: false } }, render: {