Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
javascript
phantomjs
10useragent.js
10useragent.js
/** * Modify User-Agent header */ var page = require('webpage').create(), url = 'http://play.webdevelopment-tutorials.com/test/08headers.php'; page.settings.userAgent = 'MyBrowser'; //modification of Http Header page.open(url, function(status) { var doc = page.evaluate(function() { return document.documentElement.outerHTML;; }); console.log(doc); // User-Agent : MyBrowser phantom.exit(); });
Reload page
Preview
W3C validation
Edit Code
JS Console