Created
April 26, 2010 13:55
-
-
Save robflaherty/379356 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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)); | |
})(); |
Great work bud! So simple and elegant! Love it :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome work! It looks really nice. Going to try it out on my iPad now. =)