The title is pretty self-explanatory..
Is there a way to read whatever's been output to the console.log up until the moment you decide to read it, using Javascript?
You can make a proxy around it, such as :
(function(win){
var ncon = win.console;
var con = win.console = {
backlog: []
};
for(var k in ncon) {
if(typeof ncon[k] === 'function') {
con[k] = (function(fn) {
return function() {
con.backlog.push([new Date(), fn, arguments]);
ncon[fn].apply(ncon, arguments);
};
})(k);
}
}
})(window);
console.delete console; is not a common line of code. If a script did that, I'd be worried what else it was doing. I wouldn't waste your time with an interval. As for being "quick enough", just load this as the 1st script on your page, that way you can be sure it's first.for(var k in console) if(typeof console[k] === 'function') console.log(k) seems to work at least in chrome.
console.logto use an internal queue (and also write-through) - or perhaps look into browser/extension specific support (e.g. any Firebug hook?).