Zorayr
Zorayr

Reputation: 24912

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?

Upvotes: 85

Views: 47512

Answers (6)

Jon
Jon

Reputation: 16728

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+

Update: At least in Safari 17 (not sure about 15-16), there are separate "Preserve Log" options for the Network tab and the Console. It's under the menu icon that looks like a circle with three horizontal lines of descending lengths and appears in the top bar of each tab.

Upvotes: 72

Luckylooke
Luckylooke

Reputation: 4539

Omg, I spend so much time to find it in version 16, it is currently at Console tab but under some dedicated icon.

enter image description here

Upvotes: 3

Fabio
Fabio

Reputation: 499

As of October 2022, Safari 16 and MacOS Monterey 12.6, for some reason the setting is now hidden here:

safari 16+ preserve logs location

safari 16+ preserve logs option

As @joseantgv wished in the accepted answer's comments, they excelled again and were able to hide it a little bit more 🤣🤷🏽‍♂️

Upvotes: 16

gabo bernal
gabo bernal

Reputation: 759

For old Safari versions, you can right-click on the console and select the Keep Log on Navigationenter image description here

Upvotes: 0

Daniel Compton
Daniel Compton

Reputation: 14559

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.

Console 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".

enter image description here

Upvotes: 16

rvighne
rvighne

Reputation: 21897

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.

Upvotes: 7

Related Questions