cburgdorf / grunt-html-snapshot

A grunt task that takes html snapshots from websites. Useful to make ajax sites crawlable
MIT License
230 stars 45 forks source link

Add user agent as an option #17

Open robwha opened 10 years ago

robwha commented 10 years ago

I'm trying to pass the user agent into Phantomjs to emulate mobile pages. Any ideas on how or could this be added?

nikolassv commented 9 years ago

I have just merged a pull request that adds a new property to the options: pageOptions. This property will be used as options for phantomJS' page object. You should now be able to set the user agent with: options.pageOptions.settings.userAgent = "Your User Agent". See http://phantomjs.org/api/webpage/property/settings.html for more information.