Skip to content

Commit

Permalink
Working on a way to distinguish PhantomJS use as a command line vs a …
Browse files Browse the repository at this point in the history
…web page (#168)
  • Loading branch information
ArnaudBuchholz committed Oct 16, 2017
1 parent eb614e5 commit 8e13241
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/host/phantomjs/page.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
/*global phantom*/

var fs = require("fs"),
webPage = require("webpage"),
Expand All @@ -7,8 +8,11 @@ var fs = require("fs"),
sUrl = "http://localhost:" + settings.serve.httpPort + "/test/host/phantomjs/page.html";

console.log("Opening " + sUrl);
page.open(sUrl, function (status) {
console.log("Status: " + status);
console.log(page.module.exports);

page.onConsoleMessage = function (msg/*, lineNum, sourceId*/) {
console.log(msg);
};

page.open(sUrl, function () {
phantom.exit();
});

0 comments on commit 8e13241

Please sign in to comment.