0

To show a sites source in FireFox, you can just type view-source:<URI-here> before the URL.

example: view-source:https://www.facebook.com/

Deduplicator
  • 44,692
  • 7
  • 66
  • 118

2 Answers2

2

go to preferences -> advanced and enable the developer menu. then from the developer menu you can view source.

Z .
  • 12,657
  • 1
  • 31
  • 56
  • You missunderstund my question. I wanted to call the Source Code just with a link ;) view-source:http://xxxxxxx.com/ – user2488971 Dec 26 '13 at 02:01
0

Directly, no. Safari doesn't support addresses starting with "view-source:".

There is a solution on another SO question here. Content of tag is grabbed by javascript and put in a popup window. But it only works to show the content of current website.

test.html:

<html>
<head>
<script type="text/javascript">
function ViewSource()
{
    var source = "<html>" + document.getElementsByTagName('html')[0].innerHTML + "</html>";
    // replace < and > symbols
    source = source.replace(/</g, "&lt;").replace(/>/g, "&gt;");
    // add <pre> tags
    source = "<pre>"+source+"</pre>";
    // open the window
    sourceWindow = window.open('','View source!','height=800,width=800,scrollbars=1,resizable=1');
    // set the source as the content
    sourceWindow.document.write(source);
    // close the document for writing, not the window
    sourceWindow.document.close(); 
    // give source window focus
    if(window.focus) sourceWindow.focus();
}
</script>
</head>
<body>
    <input type="button" value="View source!" onClick="ViewSource()" />
</body>
</html>
Community
  • 1
  • 1
afaf12
  • 5,163
  • 9
  • 35
  • 58