Created
August 28, 2009 00:31
-
-
Save ento/176675 to your computer and use it in GitHub Desktop.
User script to inject Javascript Profiler on document load
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
/* | |
* | |
* Author: ento | |
* | |
* Copyright (c) 2005-2008, Jaidev K Sridhar | |
* Released under the GPL license | |
* http://www.gnu.org/copyleft/gpl.html | |
*/ | |
// ==UserScript== | |
// @name Inject profiler | |
// @namespace tag:entot.to,:2009-08-22:injectprofiler | |
// @description run console.profile() on page load | |
// ==/UserScript== | |
(function(){ | |
var started = false; | |
document.addEventListener('load', function(){ | |
if (!started) { | |
alert("loaded"); | |
console.profile(); | |
started = true; | |
window.setTimeout(function(){ | |
console.profileEnd(); | |
}, 1000*60); | |
} | |
},true); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment