Open Osmosis311 opened 10 years ago
Vote up! For now one could use this hack:
function setUserAgent(page, ua) {
page.setFn('EVIL_EVAL', 'page.settings.userAgent = "' + ua + '"');
}
I think API should be more broad to support setting of nested page properties like
page.set('settings.userAgent', ua);
but not only userAgent or any of page.settings
https://github.com/ariya/phantomjs/blob/master/examples/useragent.js