How to stop OpenLayers from loading firebug lite - javascript

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

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.

are you including an external file like firebug.js or something like that in the code.. I dont think it should do anything by defualt and it must hv sm code that checks if a certain objects exists in the scope or something.
Hope you are not using some example code and that is why you are facing this issue.
also make sure that you have the irght version of OL and not a patched version or a beta version.
please update us.
A link that I found: http://osgeo-org.1803224.n2.nabble.com/Firebug-Error-Invalid-Object-Initializer-td2866563.html
btw this is openlayers stand on it:
add OpenLayers.Console namespace and a number of methods that allow for logging of error messages - when firebug.js is included in a page, the application runs in "debug" mode - the Firebug extension or Firebug Lite handles OpenLayers.Console calls depending on availability

I ended up just commenting out the line that adds the iframe. And I load a script before OpenLayers which creates a backup of window.console.
window.console2 = {};
for(key in window.console)
window.console2[key] = window.console[key];

Related

mixpanel-2-latest.min.js:9 Mixpanel error: "mixpanel" object not initialized

mixpanel-2-latest.min.js:9 Mixpanel error: "mixpanel" object not initialized. Ensure you are using the latest version of the Mixpanel JS Library along with the snippet we provide.
From the last couple of days, I am seeing this error in the console when I do inspect element in my Google Chrome. I am using the latest Chrome version 64. I am not using mixpanel. It's also showing up if I open any public website. Any idea how to resolve this error?
Check your extensions, for me it was 'Page Ruler' (https://chrome.google.com/webstore/detail/page-ruler/jlpkojjdgbllmedoapgfodplfhcbnbpn?hl=nl) that caused this error. Systematically disable all extensions until the error does not occur anymore.
I started getting this error out of the blue. It was the chrome extension PageRuler. I trashed PageRuler and the error went away.
Alternatively, you can go to Page Ruler's options menu, and uncheck "Send Anonymous Usage Statistics".
This will enable you to continue using the extensions without seeing the error message.
That's correct. The Page ruler plugin is the one who cause the console error "Mixpanel error: "mixpanel" object not initialized".
Disable it and all good to go
"Free Video Downloader" is another cause.
Check your extensions, for me, it was 'Page Ruler'.
No need to remove 'Page Ruler', Instead of removing do the following...
Page Ruler's options menu, and uncheck "Send Anonymous Usage Statistics".
I checked all given answere in here. All sayed to disable the "Send Anonymous Usage Statistics" checkbox in the settings....
I think hiding a problem is not solving a problem. Since there were a newer version of PageRuler (i had 2.1.2, newest is currently 2.1.3) I deinstalled the old one, reinstalled the new one and from now on, no matter if I send stats or not, error doesn't appaers anymore.

Not able to access variable in google chrome console

I am using the latest version of Meteor js. I am a newbie and couldn't find the solution. I have surfed for this problem a lot.
Before going to the problem, please have look at the directory structure first.
My directory structure of the project is like this :
\client
\main.html
\main.css
\main.js
\imports
\lib
\todos
\todos.js
\server
\main.js
I have created a Mongo Object in todos.js.
export const Todos = new Mongo.Collections('todos');
This is working fine.
Now in client\main.js, I am importing this object,
import { Todos } from '\imports\lib\todos\todos.js';
Note: I tried relative and absolute both type of addressing.
I put a debugger after that and checked and the variable is there. I can access that variable on the console. But as soon as I pass the statement and all the code is rendered on the browser(google chrome), I am not able to use Todos. It is giving me a ReferenceError. The error is
Todos is not defined.
I know there is no problem till the browser is loading because I checked that. I have surfed a lot. Please help me.
Thank you in advance.
Edit 1: I am using windows 7 if that is necessary.
As the comments above said, variables declared or imported in a file/module don't end up on the developers console.
What you can do to get stuff on the console is import it to the console using require
> require('/imports/lib/todos/todos.js')
Any valid absolute path or package will work here
Note: the path separators are always *nix style /
I had a similar problem while trying to evaluate moment from Moment.js in Chrome console. It was imported by the script being debugged/under breakpoints but does not work in console. import or require Moment.js in console gave me errors and did not work for me.
I ended up switching to Firefox Developer Edition, where I can put breakpoints and then evaluate moment in its console out of the box without any problems.

jQuery fails to access a local HTML file | SCRIPT70: Permission denied

I have to implement an existing frameset with JavaScript/jQuery. I´ve embedded the developer version jQuery JavaScript Library v1.9.0.
Every time the right-frame loaded a new HTML-file a function will check the content of this new loaded document. This process will fail sometimes, it´s not possible to understand when (and why) because it occurs randomly.
This is the line which will try to access the frames content:
var Jrightframe = $(iframe.find('frameset#myID frameset frame[name="right"]').get(0).contentWindow.document);
Sometimes, as I said it above, the message will be:
SCRIPT70: permission denied jquery.js, line 3882 character 2
I think it´s a same origin policy problem because I tried this locally (C: partition). But what is the problem to load a file from the partition if the js-script runs on the same partition?
Can somebody please help me to find out what´s going on here?
I searched a long time and found multiple problems like my problem. Ok here is what solved the problem:
Update the jquery core to v1.11.0. It seems only to appear in older versions.

console.log does nothing in Firebug in Liferay

I have several debug printouts in my script with console.log(message), but no messages displayed in Console section of Firebug.
What can be a reason for this?
UPDATE 1
Neither of console.warn, console.error and console.info works.
UPDATE 2
I have a following log function:
function log(message) {
console.error(message);
$("#log").append(message + "<br/>");
}
so it logs both into Firebug console and DIV on page. I see that DIV logging works. Hence the control reaches the statements.
UPDATE 3
--irrelevant--
UPDATE 4
Update 3 was irrelevant: consoleBody in firebug.js was not always null. Later it was becoming valued.
But I saw that the content of consoleBody contains "div#log". Probably it interferes with my naming...
UPDATE 5
Renaming of ID of my DIV didn't help...
UPDATE 6
Whe I do console.log("hehe") in immediate line of firebug, it prints undefined
UPDATE 7
Looks like console.log() does not work within Liferay portlet at all; even very simple hello world portlet does not excecute this command.
Use javascript.log.enabled=false property.
This will disable firebug lite, now console.log will log to browser's console.
I'm not sure what's the reason for such behaviour for 6.0 version but I have found the reason it doesn't work in 5.2.3.
It seems that Liferay includes Firebug Lite on my page and when I press F12 it appears at the bottom. It does interceps console method calls.
Now I'm looking for correct way to remove the included script.
EDIT:
Seems like the reason for this is that I have developer mode enabled.
set JAVA_OPTS=%JAVA_OPTS% -Dexternal-properties=portal-developer.properties
Try console.info. If that fails, use one of console.warn or console.error.
There may be a setting to remove this requirement from Firefox.
The situation occurs when Liferay 6.0 is running under Eclipse. Eclipse Liferay Plugin upgrade to 1.5 didn't help.
One can set fresh Liferay installation, run it under Eclipse and try console.log('hehe') in Firebug's immediate line -- it won't work.
But this bug does not occur in Liferay 6.1 with Tomcat 7.
Looks like it was some bug of Liferay 6.0. Log works in Liferay 6.1
$("#log") does not work in Liferay 5.2. The right syntax (in no-conflict mode) for Liferay is jQuery("#log") as they use multiple js frameworks.
Someone has found a way to disable Firebug-Lite completely by renaming the dirname
webapps/ROOT/html/js/firebug.. It seems to work but I also did what SO user "Yogesh Agrawal" suggested in his answer from Jul 4 at 5:27
See http://www.liferay.com/community/forums/-/message_boards/message/14202657

Ajax problem using MooTools/jQuery - p.onStatusChange is not a function

I get the following error in firebug in Firefox 3 with both MooTools and jQuery:
"p.onStatusChange is not a function".
I've noticed this error frequently in firebug since one of the latest updates of FF3. However, it has started appearing with code that hasn't been changed in some time and that was not reporting errors previously. The errors happens when ajax results are returned. It shows up in different applications that use separate javascript libraries, MooTools and jQuery.
Does anyone have any idea why these errors are appearing? My intuition tells me that it is something in Firefox that changed, but I can't find any information online currently. The ajax calls still work fine, but I am wary of just going with my intuition and leaving script errors in my code.
Thanks,
Jason
I get it in tabBrowser instead:
chrome://browser/content/tabbrowser.xml
(4) errors occur:
p.onStatusChange
p.onProgressChange
p.onStateChange
p.onSecurityChange
What I found was that the add-on "PDF Download" was causing these errors. The best way for me to check was to go to a page that produced the errors, turn off all the add-ons, and turn them on one-by-one (starting with Firebug). Instead of going one-by-one, I actually turned them on in lots of 3 to help identify the problem sooner.
Here is the reference for the function NsIDownloadProgressListener. It looks like it has been deprecated.

Categories