Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatblat/3729741 to your computer and use it in GitHub Desktop.
Save phatblat/3729741 to your computer and use it in GitHub Desktop.
/*
* Bookmarklet for viewing source in iPad Safari
*/
javascript:(function(){
var w = window.open('about:blank'),
s = w.document;
s.write('<!DOCTYPE html><html><head><title>Source of ' + location.href + '</title><meta name="viewport" content="width=device-width" /></head><body></body></html>');
s.close();
var pre = s.body.appendChild(s.createElement("pre"));
pre.style.overflow = 'auto';
pre.style.whiteSpace = 'pre-wrap';
pre.appendChild(s.createTextNode(document.documentElement.innerHTML));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment