Cannot execute Javascript from Chrome console - javascript

In the past it has been possible to write JS in the Chrome console (and is still possible on Firefox). However for the last month or so this hasn't worked, anything I type in there is silently accepted with no obvious impact, functions I call are clearly not run, etc. See this screenshot where even a direct console.log() fails to produce output:
I can't find any documentation indicating the feature was removed nor can I find any obvious causes for why this isn't working anymore. This is happening in Chrome 52.

Step 1:
The little icon next to the no smoking looking sign that looks like a half of an hour glass (see image), click on it. This is the filter settings.
Step 2:
It will give you this option:
Click on the logs or all tab to show console logs.

Related

Get browser console to show filename + line number in javascript file

a tricky question to word. I'm new to React and have been debugging my code using console logs in Firefox.
However, at times the Firefox console window stops showing the filename and line number of the console log and displays a different format. I can click on it to inspect it in Firefox's debugger but I'd prefer to change it to the standard filename:line number view. Anyone know how to do this?
I'd prefer to keep it like this:
And not like this:
Still unsure as to why this happens - but the quick solution is to restart npm via command line. Browser's command line then resumes the form of the first image above.
npm start

Error handling response: TypeError: a.replace is not a function 'With a catch'

I'm getting this error message without any script codes myself, and was wondering how I could find what is causing the issue. How can I find which extension it is, I'm dumb enough to find where I can see where all my extensions are. Just very busy learning a new language and applying it to a very important job
I've checked my code and saw it in many CLI projects, even when i just code html, and now when I code in vanilla javascript and python. This happens with or with any code written, I don't even have to use a.replace(I've never used it and it shows every time I put some code in).
Error handling response: TypeError: a.replace is not a function
at hostname (chrome-extension://ocdjppogihmiaookphgljdbcjemckmjl/content_script/inject.js:1:1663)
at chrome-extension://ocdjppogihmiaookphgljdbcjemckmjl/content_script/inject.js:1:2950
If you can tell me where to find all my chrome extensions so I can hunker down and figure out which one cool.
Now if you know how I can find which one is the source of the problem, I'd buy you dinner and give you a big hug (^:;
If what you're looking for is how to find your chrome extensions, you can do this by clicking the three vertical dots underneath of the browser's "X" in the top right corner, in the drop down menu click settings, then in the window it brings up look on the left and there will be a list that has "extensions" in it. Click that, then in the window it brings up it would probably be helpful for you to turn on Developer mode which is a switch in the top right corner of the page.
Hope this helps

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

How to view detailed Script errors instead of in IE

When there is a Javascript error in IE I get an 'Errors on this page may not work correctly' by clicking the tray in the bottom left corner. I've used Firebug and couldn't find anything that could do it yet. Maybe i'm missing something, or is there anything else that offers the same type of functionality of IE script errors, but instead of showing the just the error line #, it will also possibly show a snipped of the code or elaborate a bit more?
In Firefox/Firebug, you can right-click on an element in your browser page and select Inspect Element with Firebug. Once Firebug is open, click on the Console tab. In the console tab, you can choose what kind of errors you want to see. Javascript errors will show with either "All" or "Errors" selected.
It will show you the line number of the error, the error message and give you a link you can click on to open that part of the javascript source so you can see exactly where the error occurred.
There are some types of parse errors where the error is discovered many lines after the cause so the extra line it points to is not always correct. For javascript execution errors, the exact line should always be correct.
The newer versions of IE have something similar builtin. If you press F12, the IE debug console window opens and you can see similar information there.
Chrome and Safari also have a debugger and error console built in.

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