How to stop OpenLayers from loading firebug lite

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

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

At first I did not understand that it was OL, so I removed the firebug lite plugin. Then I checked the source of the OL and found where it is trying to enter firebug.

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

Is there a way to prevent OL from executing other than changing the source. He also overwrites window.console

+4
source share
3 answers

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

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

before downloading the openlayer script.

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

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

which means that I think that if there is no FIREBUG console, the console will be cleared and overwritten.

I think it should be a mistake, so I just did not go into it and try to fix it as soon as possible, expecting an error fixed by the Openlayer guy.

Hope this works for you, if not, let me know.

+4
source

You include an external file like firebug.js or something in this code. I don’t think he should do something defualt, and he should hv sm code, which checks if certain objects exist in the area or something like that.

Hope you are not using some kind of sample code, and that is why you came across this problem.

also make sure that you have the wrong version of OL and not a patched version or beta. please specify us.

Link I found: http://osgeo-org.1803224.n2.nabble.com/Firebug-Error-Invalid-Object-Initializer-td2866563.html

btw is open positions on it: add the OpenLayers.Console namespace and a number of methods that allow you to log error messages - when firebug.js is included in the page, the application starts in "debug" mode - the Firebug or Firebug Lite extension handles OpenLayers.Console calls subject to availability

+2
source

In the end, I just commented out the line that adds the iframe. And I load the script before OpenLayers, which backs up window.console.

 window.console2 = {}; for(key in window.console) window.console2[key] = window.console[key]; 
0
source

All Articles