Created attachment 382846 [details] Reproducible test case When "Preserve Log" is disabled in the Console, the Console is cleared late after a page is loaded. This can cause log messages to be lost. This problem does not occur when "Preserve Log" is enabled. I discovered this bug because my Safari app extension was logging the window.href on load, but I wasn't always seeing the log message as I was navigating the web and clicking on links. I was able to find an easily reproducible test case, attached as "test.html", which simply logs to the console at various times during page load. You can see in the attached screenshots how the log messages get lost when the page is reloaded and "Preserve Log" is disabled. The expected behavior is that the log is cleared before the page starts loading, so that all log messages on the page would be displayed.
Created attachment 382847 [details] Screenshot 1
Created attachment 382848 [details] Screenshot 2
Created attachment 382849 [details] Screenshot 3
I'm reproducing this bug on macOS 10.14.6 (18G1012) using Safari Version 13.0.3 (14608.3.10.10.1) and Safari Technology Preview Release 95 (Safari 13.1, WebKit 14609.1.7) (By the way, the bug also occurs with all Safari extensions disabled.)
<rdar://problem/56951808>