I am relatively new to using PhantomJS, and would like to take screenshots of our website to be diffd later on. What I am curious to know is whether or not changing the user-agent setting will affect the perspective of the screenshot (i.e. will the image appear different)? - If it will not, how would you suggest me being able to take screenshots emulating different browsers (hopefully using Phantom, but open to suggestions)?
// PhantomJS Code
page = require('webpage').create();
// Used for Firebird (old Firefox)
page.settings.userAgent = 'Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031007 Firebird/0.7';
// Used for Chrome
page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36';
page.viewportSize = {width: 1200, height : 800};
page.open("webAddress", function() {
page.render(picName);
pahntom.exit();
});
Link to HTML/CSS code used and referenced below
Yes, I have tested by changing the user agent attribute, and have taken screenshots to confirm (code above). Our site is rathe well defined, and does not generally change from browser to browser, so this is more of precautionary action. - I have also tried to make changes that would deliberately cause the site to look different when used in different browsers. They still appear to captured the same way by PhantomJS no matter what I change.
** Disclaimer: As noted, I am relatively new to PhantomJS. I have read through much of the documentation, and related posts, but have not really found an answer to my question yet. I am also a new web developer (have done much backend programming so I'm not necessarily a newbie programmer) so perhaps my "deliberate" changes were incorrect? Or, perhaps I'm not using the user-agent attribute in the correct manner?
Please let me know if I could be more specific. - Any/all help would be greatly appreciated!