1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-16 11:37:32 +02:00
dockerfiles/webkit/tests/test.js

28 lines
688 B
JavaScript
Raw Normal View History

2014-12-24 13:30:14 +02:00
#!/usr/bin/env phantomjs
var client = require('../client');
var parser = require('../parser');
var req = {
targetUrl: 'http://www.baidu.com',
requestType: 'script',
loadImages: true,
resourceUrlBlacklist: [],
timeout: 60000,
delayTime: 1000,
injectedScripts: ['./input.js'],
execScripts: {preInjected: ['new Date().getTime()', 'Math.sqrt(2)'], postInjected: ['1+2+3']},
}
var id = client.urlopen(parser.setDefaults(req), function(err, res) {
if(err) {
console.log('========== success =========');
} else {
console.log('========== fail =========');
}
console.log(JSON.stringify(res, undefined, 2));
});
console.log(id);