Skip to content

Instantly share code, notes, and snippets.

@florianbachmann
Forked from sindresorhus/LICENSE.txt
Created May 17, 2012 19:38
Show Gist options
  • Save florianbachmann/2721150 to your computer and use it in GitHub Desktop.
Save florianbachmann/2721150 to your computer and use it in GitHub Desktop.
View source - view the generated source of a page (140byt.es)

View source (140byt.es)

View the generated source of a page. 72 bytes.

Alternative version with non-english support (96 bytes):

function(){open('data:text/plain;charset=utf-8,'+encodeURI(document.documentElement.outerHTML))}
function(){
open(
'data:,'+encodeURI(
document.documentElement.outerHTML
)
)
}
function(){open('data:,'+encodeURI(document.documentElement.outerHTML))}
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
{
"name": "viewSource",
"description": "View the generated source of a page.",
"keywords": [
"140bytes",
"view",
"source",
"html"
]
}
<!doctype html>
<title>viewSource</title>
<script>
var viewSource = function(){open('data:,'+encodeURI(document.documentElement.outerHTML))};
viewSource();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment