Search code examples
javascriptgoogle-chromefirebugopenlayersfirebug-lite

How to stop OpenLayers from loading firebug lite


When I started working with OpenLayers, console.log stopped working and I kept getting this error in the chrome terminal.

GET http://127.0.0.1/my/private/dir/undefined/firebug.html 404 (Not Found)

At first I didn't realize it was OL so I uninstalled the firebug lite plugin. Then I checked the OL source and found where it's trying to inject firebug.

y=document.createElement("iframe");y.setAttribute("src",o+"/firebug.html");

Is there a way to prevent OL from doing that other than modifying the source. Also, it's overwriting window.console


Solution

  • I met the same problem. I fixed it for the moment by adding:

    <script type="text/javascript">
            console.firebug=true;//fix the openlayer problem
    </script>
    

    before loading the openlayer script.

    the reason: console.log used to work in the previous version of Openlayer ,but not for now, so I checked the source code found there is:

    if (!window.console || !console.firebug) { ...

    which means I guess if there is no FIREBUG console, the console will be cleaned up and overwritten.

    I think it should be a bug , so I just didn't get further into this, and try to fix it as soon as possible, waiting for the bug fixed by the Openlayer guy.

    hope it work for you, if not,please let me know.