source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-windows/examples/useragent.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: 484 bytes
Line 
1var page = require('webpage').create();
2console.log('The default user agent is ' + page.settings.userAgent);
3page.settings.userAgent = 'SpecialAgent';
4page.open('http://www.httpuseragent.org', function (status) {
5 if (status !== 'success') {
6 console.log('Unable to access network');
7 } else {
8 var ua = page.evaluate(function () {
9 return document.getElementById('myagent').innerText;
10 });
11 console.log(ua);
12 }
13 phantom.exit();
14});
Note: See TracBrowser for help on using the repository browser.