Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rhwy/418889 to your computer and use it in GitHub Desktop.
Save rhwy/418889 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=720, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0" /></head><body></body></html>');
s.close();
s.body.innerText = document.documentElement.innerHTML;
s.body.style.whiteSpace = 'pre-wrap';
s.body.style.display = 'block';
s.body.style.font = "normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace";
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment