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

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

Related

Mozilla firefox debugger not working

When debugger is enabled in firefox by pressing F12 it is disabling the editing feature in the website for which debugger is opened for. Firefox version is 58.0.1
The new UI of firefox is having some problems for me. Once I open the debugger UI cannot do any operations on the web page. Hence went back to old UI by setting the below property to false in browser.
Go to firefox browser. In the address bar type, "about:config". Without the quotes. Search for the below property and toggle it. The value can be toggled(changed) by right clicking or by just clicking on the entry. Set this property to false which takes back to old UI.
property to be altered ==> devtools.debugger.new-debugger-frontend
One of the easiest ways to fix any error is to reset your Firefox under about:support. Lookut for somethin like clean or refresh or reset

Can't open chrome inspector with javascript prompt is running

I'm trying to open the Chrome inspector to see the console log and I can't.
It works very well with Firefox but not with Chrome.
The chrome development tools is enabled and works well when there is no prompt or alert pop up running.
I have a little program in which I have a prompt that asks the user to give a number.
Explanations for the user are in the console(console.log("xxxx")), so when the page is loaded and the prompt is on the screen, the user would have to open the inspector window to see what choice he/she should make.
Here is my code:
console.log("1\n2");
var saisie = prompt("What is your choice");
alert(saisie);
I would like the user to see the console log before they answer the prompt.
You can use window.console to access and interact via javascript with the debug console. Then you can pipe its contents to a div on the page.
alert is blocking, which is why people tell you not to use it (or leave snarky comments to that effect). 'Blocking' means that nothing else can happen: it literally hijacks the entire tab. Meaning that you can't, say, open chrome devtools without dismissing the alert first. I have no idea how this is actually working in FF.
Pro-tip: don't ever use alert. Ever. Use a modal dialog, iframe, whatever. Don't use alert.

Is it possible to see chrome console while being in source debugger?

I want to debug javascript and see a console at the same time (something like having two separate windows). I can not find a way to do this: either a debugger or a console.
Yes. There is an button that looks like >= in the top right of the developer tools
When you click on that it opens a drawer that allows you to run console commands
Update for 2017
The icon has been removed and is now available through the dropdown menu (which also helpfully shows the keyboard shortcut: Esc)
Press escape while in the debugger to open the console.
You may also open up the console to experiment while paused. Hit the [Esc] key to bring the console into view.

Chrome devtools: Drop into debugger without switching to Sources tab

If I put the debugger statement in my JavaScript source with the Chrome devtools open, it'll stop execution so I can interactively explore the current context from the console. It's really awesome.
But unfortunately it will also switch to the Sources tab and display the line where the debugger statement happened. Most of the time, I want to type JavaScript commands, so I have to manually switch back to the Console tab.
Can I avoid the tab-switching and stay in the Console tab?
Or am I using it wrong?
Right-click on the source-tab and select 'move to bottom'.
Looks like Chrome added a preference for this in the intervening 9 years: https://stackoverflow.com/a/69216922/66673
Quoting that answer:
I had the same issue and it was driving me nuts! The way I managed it to stop switching was to go to into the DevTools settings -> Preferences.
Under Sources options, uncheck Focus Sources panel when triggering a breakpoint.
There's a reason for that - and is that whenever the code has stopped, because of a breakpoint or a debugger statement, you'd usually want to actually see where the execution has stopped. So, the developer tools switches to the Scripts/Sources tab, and this is a common behaviour among the major browsers, that may also show the local variables, the call stack and so on.
The best thing you can do is to keep the console frame always open, so you're ready to work. Just press Esc or click on the second icon on the lower left corner. That's what I usually do.
Switch to the Console tab when you expect to get a large response from the command you type.

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

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)

Categories

Resources