forked from gruntjs/grunt-lib-phantomjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow passing page options into phantomjs
Merged in from STRML/grunt-lib-phantomjs@e356ada (Essentially merged and squashed commits of gruntjs#21 and gruntjs#47 together)
- Loading branch information
Showing
7 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<script> | ||
|
||
function sendMessage() { | ||
var args = [].slice.call(arguments); | ||
alert(JSON.stringify(args)); | ||
} | ||
|
||
var headers = <% headers %>; | ||
|
||
sendMessage('test', headers['x-custom']); | ||
sendMessage('done'); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var fs = require('fs'); | ||
var express = require('express'); | ||
var port = 8075; | ||
var site = express(); | ||
|
||
site.get('*', function(req, res) { | ||
fs.readFile('./test/fixtures/headers.html', 'utf8', function (err, data) { | ||
if (err) throw err; | ||
var tmpl = data.replace(/<% headers %>/, JSON.stringify(req.headers)); | ||
res.write(tmpl); | ||
res.end(); | ||
}); | ||
}); | ||
|
||
site.listen(port); | ||
|
||
console.log('Listening on port ' + port); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<script> | ||
|
||
// Send messages to the parent PhantomJS process via alert! Good times!! | ||
function sendMessage() { | ||
var args = [].slice.call(arguments); | ||
alert(JSON.stringify(args)); | ||
} | ||
|
||
var viewportWidth = document.documentElement.clientWidth; | ||
var viewportHeight = document.documentElement.clientHeight; | ||
|
||
sendMessage('test', viewportWidth, viewportHeight); | ||
sendMessage('done'); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |