Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save eric/418811 to your computer and use it in GitHub Desktop.

Select an option

Save eric/418811 to your computer and use it in GitHub Desktop.

Revisions

  1. eric revised this gist May 30, 2010. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ipad-view-source-bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    /*
    * Bookmarklet for viewing source in iPad Safari
    * Originally from http://www.ravelrumba.com/blog/ipad-view-source-bookmarklet/
    */

    javascript:(function(){
  2. eric renamed this gist May 30, 2010. 1 changed file with 0 additions and 0 deletions.
  3. eric revised this gist May 30, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ipad-view-source-bookmarklet
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ 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=980, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0" /></head><body></body></html>');
    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;
  4. eric revised this gist May 30, 2010. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions ipad-view-source-bookmarklet
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,12 @@
    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.write('<!DOCTYPE html><html><head><title>Source of ' + location.href + '</title><meta name="viewport" content="width=980, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0" /></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));

    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";
    })();
  5. @robflaherty robflaherty revised this gist Apr 26, 2010. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion ipad-view-source-bookmarklet
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    //Bookmarklet for viewing source in iPad Safari
    /*
    * Bookmarklet for viewing source in iPad Safari
    */

    javascript:(function(){
    var w = window.open('about:blank'),
    s = w.document;
  6. @robflaherty robflaherty revised this gist Apr 26, 2010. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ipad-view-source-bookmarklet
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    //Bookmarklet for viewing source in iPad Safari
    javascript:(function(){
    var w = window.open('about:blank'),
    s = w.document;
  7. @robflaherty robflaherty created this gist Apr 26, 2010.
    11 changes: 11 additions & 0 deletions ipad-view-source-bookmarklet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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));
    })();