Yes, but you can't add the script to the page because you can't get
control after the document is valid but before any javascript (which
could use the console) can run. For example, if the first tag in the
page is <script> console.log('ff'): ...
You can eval an object or function, but the environment will be
evalInSandbox, so you won't have the same Javascript world as the
page. So you can't load the whole console, just a loader to do it
later.
So that leaves you with needing a function call to trigger the "do it
later" bit.
It could be "loadFirebugConsole()" as I propose. Or it could be
window.console using a getter method. I guess it could be
firebug.__defineGetter__("console", function() {
}
On Apr 2, 12:44 pm, "Mark Kahn" <
cwol...@gmail.com> wrote:
> Unless running it via a plugin changes the functionality:
>
> <script>
> function loadFirebugConsole(){
> alert('loadFirebugConsole');
> // do stuff here
>
> }
>
> var firebug = {};
> firebug.console = {
> init: function(){
> loadFirebugConsole();
> firebug.console = firebug._console;
> },
> log: function(){
> this.init();
> firebug.console.log.apply(this, arguments);
> }};
>
> firebug._console = {
> log: function(){
> alert('real console.log called with '+arguments.length+' arguments:
> 1:'+arguments[0]);
> }
>
> };
>
> firebug.console.log('this is a test');
> </script>
>
> -Mark
>
> On Wed, Apr 2, 2008 at 12:12 PM, John J Barton <
johnjbar...@johnjbarton.com>