How to turn off Preserve JavaScript console perseverance in Google Chrome - javascript

Currently in my Google Chrome JS console, all of my console.logs, network errors, etc. are preserved between page refreshes even though I have Preserve logs disabled. Does anyone know a fix to this? Here are my current settings for my console:

This issue has been fixed for me by doing the following:
While inspect is open press F1.
Scroll to bottom and click
'Restore defaults and reload'.
Close Google Chrome.
Reopen.
Also, you may need to delete Google Chrome and reinstall.

Related

Chrome disabled javascript and doesn't allow to enable it

I am not able to enable javascript in Chrome. Under Chrome javascript setting the default option for "sites can use javascript" is grayed out. Even if I add website manually under "Allowed to use javascript" the website is not loading, screenshot below.
This happened while I was trying to find a solution for another issue and followed solution from this page (the top answer), so I went to Chrome Devtools > Sources and clicked on the pause button since then the javascript has got disabled. Paused in debugger in chrome?
Note: Javascript is working fine in other Chrome Profiles. The issue is with this particular Chrome Profile.
Try right-clicking the "Sites can use Javascript" option, and inspect element:
Then, remove the disabled or disabled="" attribute from whatever element the console brings you to.
The option should be enabled. Click it and try reloading your site again.
If this doesn't work, you can try reporting any problems for whatever chrome has (I use Mozilla Firefox and I know they have a help center).
Or try re-installing the browser, because some files may be corrupt (don't worry, if you have an account you can sign-in after the reinstallation and everything should be synced).

Chrome JavaScript turned off

Okay, here's my problem. I wrote some JavaScript for a page, for some reason the page doesn't work in Chrome. The site does what I expect in Opera, Chromium and Firefox. In the Choom devtools there is a kind of error showing in the source tab showing "JavScript is disabled" in a mouse hover popup:
I turned off all chrome's extensions, Javascript in on in the content settings and I cleared all JavaScript exceptions I had, but this didn't seem to change anything. The weird thing (an other one) is that some other sites give the same alert icon in the devtools (including this one) but JavaScript works just fine.
If you perform the exact same functions in the console then, some of, the functions perform just fine.
Does anyone have an idea what I could be because I am out of idea's and it is really annoying that I have to switch browser to test the page (page is 'live' here). Thanks
Have you checked the DevTools settings? You might have accidentally enabled "Disable Javascript"

Safari Developer Tools: How to Preserve Console Log Upon Navigation?

When using Safari Web Inspector to read the JavaScript console output, the log is reset upon navigation i.e. going from page index.html to mail.html clears the console output. In the Chrome Developer Tools, I can easily preserve the log by right clicking on the console space and selecting Preserve Log Upon Navigation. With this option, console log output remains intact until I manually clear the output simplifying the process of debugging JavaScript that refreshes or redirects to another page.
Is there a similar feature in Safari Web Inspector?
I don't know when this was added, but it is present in Safari on El Capitan (Safari 9.0). It works the same as in Chrome (right click in the console window and select "Keep Log on Navigation").
Update: As per Daniel Compton's answer, in Safari 11+ this is now under the settings icon as 'Console: Clear when page navigates'.
Update: The setting is now back to "Preserve log" in the Network tab in the developer console in Safari 14+
In Safari 11.1.2 they moved it again(!) back to the Console tab under the "Preserve log" checkbox. The Network log has similarly moved back to the Network tab.
In Safari 11 they moved it to the Settings panel under "Console: Clear when page navigates". It also has a sister setting "Network: Clear when page navigates".
No, there is no such feature (in Safari 5.0 at least). Looking at some Google results, I don't think this feature exists in any Safari version.
As of October 2022, Safari 16 and MacOS Monterey 12.6, for some reason the setting is now hidden here:
As #joseantgv wished in the accepted answer's comments, they excelled again and were able to hide it a little bit more 🤣🤷🏽‍♂️
For old Safari versions, you can right-click on the console and select the Keep Log on Navigation

Javascript, Losing console.log between url posts

I am trying to watch my javascript code using the console.log(text) command - and it does work... but the console gets flushed everytime the url changes.
Is there any way to persist my console logs between page changes?
Click on the bottom-right corner gear icon in the Chrome developers tool, check 'Preserve log upon navigation' option and you are done.
For the record, these days both Firefox and Chrome have 'persist' options in their inspectors / conosole. You need to right click in the console window and then select the relevant option tfrom the popup menu.
There isn't a way to do this yet but from what I've read it is a future feature they will implement. Here is the Issue ticket on it: http://code.google.com/p/chromium/issues/detail?id=77058
EDIT:
Chrome has implemented this feature. Read the answer below
There's only 1 way that I know of, but not with Chrome: With the built-in Web Inspector in Firefox 4+, which doesn't flush the logs between pages.
#scrappedcola notes that Firebug does this as well, but I'm referring to the built-in inspector.

how to check javascript syntax error

Firebug looks not capable to check js syntax error...
Is there any good way to do that?
Currently I just wrote a js but the firebug didn't show any error but the functionality is totally broken.
Firebug does do it. Make sure that you have JavaScript Console enabled, you can do so by clicking the Console dropdown and from their select Enabled. You need to press F12 key to open firebug and once you refresh the page, you will see any errors you have in your script in the firebug js console.
If you are using Firefox, you can also press Contr+Shift+J to open firefox's error dialog.
are you sure Firebug is turned on? If it's on, the little bug in the lower right is colored brown. if it's not on, the bug is gray.
also, I find that Web Inspector in Safari/Chrome is better.

Categories