Skip to content

Instantly share code, notes, and snippets.

@fael
Created September 14, 2011 21:51
Show Gist options
  • Save fael/1217901 to your computer and use it in GitHub Desktop.
Save fael/1217901 to your computer and use it in GitHub Desktop.
Load Firebug Lite when sequence "d e b u g" is typed
var hasFirebugLite = false;
runFirebug = function () {
if (!hasFirebugLite) {
$.getScript('https://getfirebug.com/firebug-lite.js', function () {
hasFirebugLite = true;
});
}
}
enableFirebug = function () { //soh funciona uma vez! nao tentar digitar a sequencia denovo
var fbkeys = [],
firebugSequence = "68,69,66,85,71";
$(window).bind('keydown', function (e) {
fbkeys.push(e.keyCode);
if (fbkeys.toString().indexOf(firebugSequence) == 0) {
runFirebug();
}
});
if (window.location.href.indexOf('debug') > 0) {
$("<a href='#'>Open Firebug Lite</a>").click(runFirebug).appendTo("body");
}
}
$(enableFirebug);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment