Skip to content

Instantly share code, notes, and snippets.

@chriscorwin
Last active August 29, 2015 13:58
Show Gist options
  • Save chriscorwin/9957296 to your computer and use it in GitHub Desktop.
Save chriscorwin/9957296 to your computer and use it in GitHub Desktop.
javascript:(function() {
window.nodes;
window.timeoutLength = 200;
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
if (window.location.protocol !== 'https:') {
po.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js";
} else {
po.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js";
window.timeoutLength = 600;
}
var s = document.getElementsByTagName('body')[0];
s.parentNode.appendChild(po, s);
function copyToClipboard() {
window.prompt("Copy and paste this into console to get source:", "copy(nodes);");
}
function runIt(){
jQuery.noConflict();
printHTML();
};
function printHTML() {
window.nodes = jQuery('body').html();
console.group('Source:');
console.log(window.nodes);
console.groupEnd();
copyToClipboard();
}
var timeoutID = window.setTimeout(runIt, window.timeoutLength);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment