How to view the html page source of a website in Safari

safari

This is a bit of an advanced tip for web developers. Safari used to have a menu item called ‘View Page Source’. If you selected this you could see the HTML code of the website you were viewing.  This option has been removed from recent versions of Safari but you can re-enable it by turning on Safari’s Develop menu.

You can enable the extra menu in Safari by selecting ‘Preferences’ under Safari in the OS X menu bar  and then under the ‘Advanced’ pane select the checkbox that says ‘Show Develop menu in menu bar.’

Now you will see the following extra menu in Safari:

safari debug

This contains useful tools for developers.

‘Show Page Source’ will show you the HTML page source code.

You can also Empty Caches from here, and even trick a webpage into thinking you are using a different browser to see if it renders differently.

If you change your mind just type the same command into terminal but with a ‘0’ at the ned instead of the ‘1’.

 

 

Posted

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.