Skip to content

Commit

Permalink
Register webkit2 engine that uses PhantomJS 2.x (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Jul 11, 2015
1 parent 6db93f7 commit d00afdd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/engines.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ function engines(options) {

// engines storage
this.engines = {};
['webkit', 'gecko'].forEach(this.registerEngine, this);
[
'webkit',
'webkit2',
'gecko'
].forEach(this.registerEngine, this);
}

engines.prototype.registerEngine = function(engineName) {
Expand Down
16 changes: 16 additions & 0 deletions lib/engines/webkit2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Defines PhantomJS 2.x engine
*
* @see https://github.com/macbre/phantomas/pull/531
*/
var pkg = require('phantomjs2');

module.exports = {
name: 'PhantomJS',
engine: 'webkit2',
path: pkg.path,
version: pkg.version,
getUserAgent: function() {
return 'PhantomJS/' + pkg.version
}
};

0 comments on commit d00afdd

Please sign in to comment.