Skip to content

Instantly share code, notes, and snippets.

@ebello
Forked from remy/view-source.js
Created March 4, 2010 15:50
Show Gist options
  • Select an option

  • Save ebello/321823 to your computer and use it in GitHub Desktop.

Select an option

Save ebello/321823 to your computer and use it in GitHub Desktop.

Revisions

  1. @remy remy created this gist Mar 4, 2010.
    2 changes: 2 additions & 0 deletions view-source.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    // bookmarklet to introspect the source of current page
    javascript:(function(d,h){h=d.documentElement.innerHTML;d.open();d.write('<pre>'+('<!DOCTYPE html><html>'+h+'</html>').replace(/[<>]/g,function(m){return{'<':'&lt;','>':'&gt;'}[m]})+'</pre>')})(document);