OpenLayers OpenLayers

Changeset 8031

Show
Ignore:
Timestamp:
09/17/08 19:39:24 (3 months ago)
Author:
tschaub
Message:

We were breaking the firebug console in Firefox 3. This change makes things less efficient for browsers without Firebug (we loop through every script checking for firebug lite), but it fixes the console with OL and Firefox 3. If you open up the console in Firefox 3 and type 'window.console' you get an error about too much recursion (nothing to do with OL). So, we avoid touching window.console unless firebug lite has defined it. r=euzuro (see #1594)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Console.js

    r7675 r8031  
    234234     * OpenLayers.Console calls to the console object. 
    235235     */ 
    236     if(window.console) { 
    237         var scripts = document.getElementsByTagName("script"); 
    238         for(var i=0, len=scripts.length; i<len; ++i) { 
    239             if(scripts[i].src.indexOf("firebug.js") != -1) { 
     236    var scripts = document.getElementsByTagName("script"); 
     237    for(var i=0, len=scripts.length; i<len; ++i) { 
     238        if(scripts[i].src.indexOf("firebug.js") != -1) { 
     239            if(console) { 
    240240                OpenLayers.Util.extend(OpenLayers.Console, console); 
    241241                break;