source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-windows/examples/netlog.js@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 657 bytes
Line 
1var page = require('webpage').create(),
2 system = require('system'),
3 address;
4
5if (system.args.length === 1) {
6 console.log('Usage: netlog.js <some URL>');
7 phantom.exit(1);
8} else {
9 address = system.args[1];
10
11 page.onResourceRequested = function (req) {
12 console.log('requested: ' + JSON.stringify(req, undefined, 4));
13 };
14
15 page.onResourceReceived = function (res) {
16 console.log('received: ' + JSON.stringify(res, undefined, 4));
17 };
18
19 page.open(address, function (status) {
20 if (status !== 'success') {
21 console.log('FAIL to load the address');
22 }
23 phantom.exit();
24 });
25}
Note: See TracBrowser for help on using the repository browser.