How to: View a Web Page's HTML Code in Plain Text (Courier New)

Last modified: Aug 30, 2020 6:40 AM
6 2675 Last modified Aug 30, 2020 6:40 AM

How to: View a Web Page's HTML Code in Plain Text (Courier New):

If you are looking to view a Web page's source in plain text, then create a Bookmark with the below script. It will open a new tab, and will appear in clear font (Courier New) as View Source in the Bookmarks Menu


View a Web Page's HTML Code in Plain Text (Courier New):

I. Create a Bookmark

II. Rename Bookmark to View Source

III. Edit View Source Bookmark's URL


I. Create a Bookmark:

  1. Go to: Bookmarks Menu
  2. Select: Add Bookmark...
  3. Create: The Bookmark


II. Rename the Bookmark to View Source:

  1. Go To: View menu bar
  2. Click: Show Bookmarks Sidebar
  3. Right-Click: The Bookmark
  4. Select: Rename
  5. Type: View Source


III. Edit View Source Bookmark's URL:

  1. Right-Click: View Source bookmark
  2. Select: Edit Address...
  3. Copy-and-Paste: this Address:
javascript:(function()%7B%20%20%20%20%20var%20a%20=%20window.open('about:blank').document,%20b;%20%20%20%20%20a.write('%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3ESource%20of%20'+location.href+'%3C/title%3E%3Cmeta%20name=%22viewport%22%20content=%22width=device-width%22%20/%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E');%20%20%20%20%20a.close();%20%20%20%20%20b%20=%20a.body.appendChild(a.createElement('pre'));%20%20%20%20%20b.style.overflow%20=%20'auto';%20%20%20%20%20b.style.whiteSpace%20=%20'pre-wrap';%20%20%20%20%20b.appendChild(a.createTextNode(document.documentElement.innerHTML))%20%7D)();


Screenshots:


1. The Address Seen in Full:



2. What you get in the Bookmarks menu:



3. What you get when selecting View Source bookmark while on this post:

Comments

Jun 6, 2020 6:25 AM

Scroll Through to Privately Read All:

This is a very nifty way of viewing items that you may be restricted to viewing without payment. A great way to void scams.


Such an example of a site is that of a newspaper where it reads: Pay this amount to view the rest of it. But scroll down the source code, looking for font characters only, and there it is!

Jun 6, 2020 6:25 AM

Aug 30, 2020 6:40 AM

I think you can also view the source of a page directly from Safari on a Mac if you go to Safari > Preferences > Advanced and check the box for Show Develop Menu and then choose Show Page Source. Or in FireFox, Tools > Web Developer > Page Source.

Aug 30, 2020 6:40 AM

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.