Skip to content

Instantly share code, notes, and snippets.

@ento
Created August 28, 2009 00:31
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 ento/176675 to your computer and use it in GitHub Desktop.
Save ento/176675 to your computer and use it in GitHub Desktop.
User script to inject Javascript Profiler on document load
/*
*
* 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