Viewing the source code for a webpage under Safari and changing the user agent

Safari's default configuration doesn't provide a menu option to allow you to view the source code for a webpage. You can gain the option to view the underlying HTML code for a web page by opening the Safari web browser, clicking on Safari, selecting Preferences, then clicking on Advanced and then checking the check box next to "Show Develop menu in menu bar".

Safari advanced
menu options

After you do so, you will then see Develop on Safari's menu bar. If you click on it, you will see a Show Page Source option.

Generic Category (English)120x600

Safari show 
page source

The develop menu also provides a User Agent option that will allow you to change the user agent Safari reports to web sites.

Safari user agent

Some websites, instead of relying on Internet standards, will check to see what browser a visitor is using and will refuse to display some or any content if the site doesn't approve of the browser the user is using. Browsers send a "user agent" parameter to websites allowing websites to identify the browser. Spoofing the user agent Safari reports to the website may allow content to be accessed that couldn't be viewed otherwise.

Choices offered by Safari 6.2.7 (8537.85.16.12) on Mac OS X for the user agent string it sends include the following:

Selecting "Other" allows you to specify a custom user agent of your choosing.

Safari other user agent

 

TechRabbit ad 300x250 newegg.com

Justdeals Daily Electronics Deals1x1 px