Sha256: fa1532adb7abe462f19be40593416dac831ded2c9238d5720a406f286ec5c83e

Contents?: true

Size: 657 Bytes

Versions: 17

Compression:

Stored size: 657 Bytes

Contents

var page = require('webpage').create(),
    system = require('system'),
    address;

if (system.args.length === 1) {
    console.log('Usage: netlog.js <some URL>');
    phantom.exit(1);
} else {
    address = system.args[1];

    page.onResourceRequested = function (req) {
        console.log('requested: ' + JSON.stringify(req, undefined, 4));
    };

    page.onResourceReceived = function (res) {
        console.log('received: ' + JSON.stringify(res, undefined, 4));
    };

    page.open(address, function (status) {
        if (status !== 'success') {
            console.log('FAIL to load the address');
        }
        phantom.exit();
    });
}

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/netlog.js
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/netlog.js
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/netlog.js
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/netlog.js
entangled-0.0.13 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/netlog.js
entangled-0.0.12 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/netlog.js
entangled-0.0.11 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/netlog.js
entangled-0.0.10 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/netlog.js