Skip to content

Instantly share code, notes, and snippets.

@ollicle
Last active March 10, 2017 12:03
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 ollicle/ee02a5e666781a32ec9c49fc73debdff to your computer and use it in GitHub Desktop.
Save ollicle/ee02a5e666781a32ec9c49fc73debdff to your computer and use it in GitHub Desktop.
Load the current document into a resizable iframe
(function(){
document.body.innerHTML = '';
document.head.innerHTML = '';
var i = document.createElement('iframe');
i.id='theiframe';
i.style.width = '100%';
i.style.height='100%';
i.src = '?';
var wrap = document.createElement('div');
wrap.style.margin = 'auto';
wrap.style.width = '90vh';
wrap.style.height = '90vh';
wrap.style.resize = 'both';
wrap.style.overflow = 'hidden';
wrap.appendChild(i);
document.body.appendChild(wrap);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment