Console.log messages not showing up in Chrome's javascript console? - javascript

I am logging using the jQuery.log plugin (which logs to console.log if available) and I am not seeing any of the logging messages appear in the Chrome JavaScript console.
Logging works on Firebug's console under Firefox, but I did have to explicitly enable the Firebug JavaScript console. Have a missed some option somewhere under Chrome?
Edit:
The only thing being logged to the console is
Uncaught Syntax error, unrecognized expression: |button
I assume that the Chrome console is suppose to log statements even after errors like the one above, but there may be some kind of issue with Chrome here, see http://code.google.com/p/chromium/issues/detail?id=29062. I am using Chrome 5.0.375 under Linux and that bug is listed as a Windows XP, Chrome 4.0 issue, it could still apply.

I've just had the same problem and found this question when trying to find an answer.
What fixed this for me was disabling firebug lite in chrome.
It was swallowing all console messages.

Make sure you have the console showing and that it is showing "All".
The cursor is on the button to hide/show the console.
Update: In newer versions of Chrome, you need to click the filter icon, then make sure "All" is selected.

When playing around with example Chrome Extensions, I was often unable to see the console.log messages when looking at console (ctrl+shift+j). But then I realized, that I was in the wrong place.
Wrench -> Tools -> Extensions and then click on the appropriate link under "Inspect active views". (in the Chrome examples it is often background.html) This should bring up the console that you are looking for.

On my computer I had accidently clicked the Debug filter. This made my log messages hidden. Here's how it was before (hidden messages):
Here's how it was after the change (working messages):

I am not sure if this is the case, but if you are using firebug with chrome, you have to turn firebug off in order for console.log() to work in Developer Tools.

I just found out logging was disabled from my filters.

For me, it was because the script was being cached and the browser was not loading my latest version.
Try Ctrl+F5 to reload your page.

Resetting default setting works for me.
While in the console tab, pressingF1 should open the setting page. There you will different settings that you can adjust including the button Restore defaults and reload.

I have this error by have obfuscated javascript code, deobfuscate and console.log work again)

Related

Firebug 2+ Add-on Doesn't Show Error Info

Please see attached image for reference. Until very recently, Firebug add-on in Firefox would show a red error count on top right and the Console would have the javascript error info.
But looks like Firebug is no longer supported and is being integrated inside Developer Tools: https://developer.mozilla.org/en-US/docs/Tools/Migrating_from_Firebug and for that link you'd see that the error count only could be now displayed but only after pressing Shift+F2 keys - and even then error info not displayed.
I would like to see the error count red as soon as the page loads. I'd also like to see error info in the 'errors' tab of the Console, as it used to be. I have looked for a solution - even tried to revert to older Firebug but so far no success.
Any idea?
Your screenshot obviously shows the Firefox DevTools (with Firebug theme) and not the Firebug.
To see the JavaScript errors in the Web Console you need to toggle the related filter. To do that click the button in the console toolbar.
Having said that, there's a bug regarding the error count causing the number shown in the Developer Toolbar to be wrong, i.e. it often doesn't match the number of errors logged to the console.
Never mind,
Per this post: How to revert Firebug to old version?
I set all instances of browser.tabs.remote.autostart to false and Firebug seems to be working as it was before.
This maybe temp solution but it fixes my problem :)
HTH

IE11's F12 developer tools lack option to keep console on navigation

Trying to debug a problem that's IE-11 specific, I would like to see the console messages logged when a certain control is clicked. But the control refreshes the page, which makes F12 tools automatically clear the console, so whatever is logged just before that, I don't get to see!
Past versions of IE had an option to keep the console contents on navigation. Is this option available in IE11? If so, where is it? If not, is there some other way to view the console that doesn't immediately discard the message I want to see?
In with the latest F12 update to IE11 (that came as part of the Win8.1 Update) there is now a button to disable "Clear on Navigate"
Additionally, you can enable IE to record messages in the Console at all times instead of only when the Console is open.
For all the changes to the IE11 F12 dev tools see: http://support.microsoft.com/kb/2929437
Ran into this and I didn't find a good solution, but I found a hacked one that worked well enough for me to debug.
Use window.onbeforeunload to pop up a window so you can at least see the values before they are purged.
See: Prompting and preventing user from navigating away/closing a page

strange script error with firefox alone

If you open this site in chrome, it loads and runs ok but I tried loading it in firefox 19.0.2 and I keep getting a Script error asking me if I want to continue or stop. After doing some searching around I found the about:config setting, but that doesn't help. I installed firebug and I see an error about "Permission denied to access property 'toString'" but I have no clue as to what it wants or needs. And the weird part is that if you go to another page in the same site like this one it works just fine. I'm clueless as to what it can be, so any help is much appreciated.
Not a duplicate of this, since it happens on one page but not the other and they both run the same exact code. just that one loads a bit more data than the other. More than anything I'm wondering if its the amount of facebook likes on one page?
When you try to hit play button, you will get a JavaScript error in console in both Chrome and Firefox "TypeError: player is undefined". I tried it and the same error appeared in both console logs. It is and error in the page itself.
I opened it in my firefox browser and it works fine. So it may be there is an add-on which did this error. Try to disable your installed add-ons from (firefox --> add-ons) and reload the page again. If it loads fine then you can enable your add-ons one by one to check which one causes this problem.

How can I debug Javascript errors while writing Chrome extensions?

How can I see javascript error when loading chrome extensions? I've tried using developer tools but I don't see any errors there. Also if I use console.log, I don't see any output in the console.
Anyone have any ideas?
http://code.google.com/chrome/extensions/tut_debugging.html
Go to the Extensions page (chrome://extensions), and make sure Developer mode is still enabled. The Extensions page doesn't need to be open for the following to work. The browser remembers the setting, even when the page isn't shown.
Right-click the extension's icon and choose the Inspect popup menu item. The popup appears, and a Developer Tools window like the following should display the code for popup.html.
The above answer doesn't work anymore. Sadly the Inspect Popup menu item has been removed from Chrome.
But this answer works:
Debug popup.html of a Chrome Extension?
(More precisely: the second comment of the first answer on the above page helps).

Clicking a URL inside the Firefox error console no longer opens the source! FF 4

Working on a web application and find the Firefox error console to be indispensable.
However I recently upgraded to FF 4 and now when I click errors in the console, the source code doesn't come up like it used to. Not sure it's related to the upgrade but timing is about right.
I've looked over about:config options, made sure the console is enabled, etc. Spent a long time with google trying to find someone else with this problem... nothing.
I get the "hand" cursor when hovering over the URL as if clicking it will do what I expect. However, nothing at all happens. Nada.
I've looked around for hidden windows and even tiny ones but can't find anything...
Any ideas?
Well, I can't exactly figure out why this is happening, but I did find that it only happens when I have the Error Console window on a different display as the main window. I use 2 displays to make debugging easier and moving the error console window to the main display makes it work again.
On a Mac, FWIW.

Categories

Resources