Skip to content

Commit

Permalink
now you can config javascript Enabled or not
Browse files Browse the repository at this point in the history
  • Loading branch information
miniflycn committed Nov 9, 2013
1 parent 6e44396 commit cba026b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ module.exports = {
height: 600
},
clipRect: 0,
zoomFactor: 0
zoomFactor: 0,
javascriptEnabled: false
};
1 change: 1 addition & 0 deletions lib/Job.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = (function () {
opt.viewportSize && (this.viewportSize = opt.viewportSize);
opt.clipRect && (this.clipRect = opt.clipRect);
opt.zoomFactor && (this.zoomFactor = opt.zoomFactor);
opt.javascriptEnabled && (this.javascriptEnabled = opt.javascriptEnabled);
}
Job.prototype = {
constructor: Job,
Expand Down
2 changes: 1 addition & 1 deletion lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function doJob(job) {
clipRect && (page.clipRect = clipRect);
zoomFactor && (page.zoomFactor = zoomFactor);
page.settings = {
javascriptEnabled: false,
javascriptEnabled: job.javascriptEnabled || config.javascriptEnabled,
loadImages: true,
userAgent: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.31 (KHTML, like Gecko) PhantomJS/1.9.0'
};
Expand Down

0 comments on commit cba026b

Please sign in to comment.