settings
settings {object}
This property stores various settings of the web page:
javascriptEnableddefines whether to execute the script in the page or not (defaults totrue).loadImagesdefines whether to load the inlined images or not (defaults totrue).localToRemoteUrlAccessEnableddefines whether local resource (e.g. from file) can access remote URLs or not (defaults tofalse).userAgentdefines the user agent sent to server when the web page requests resources.userNamesets the user name used for HTTP authentication.passwordsets the password used for HTTP authentication.XSSAuditingEnableddefines whether load requests should be monitored for cross-site scripting attempts (defaults tofalse).webSecurityEnableddefines whether web security should be enabled or not (defaults totrue).resourceTimeout(in milli-secs) defines the timeout after which any resource requested will stop trying and proceed with other parts of the page.onResourceTimeoutcallback will be called on timeout.
Note: The settings apply only during the initial call to the page.open function. Subsequent modification of the settings object will not have any impact.
Examples
var webPage = require('webpage');
var page = webPage.create();
page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36';