Bug 205600

Summary: Web Inspector: Console clearing on reload or .clear() calls can happen after contents are logged
Product: WebKit Reporter: Jonathan Deutsch <jonathan>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: inspector-bugzilla-changes
Priority: P2    
Version: Safari 13   
Hardware: All   
OS: All   
Attachments:
Description Flags
Simple case where command-r to reload may not show console.log
none
console.clear and subsequent console.log won't be seen none

Jonathan Deutsch
Reported 2019-12-26 20:49:56 PST
A clear of the console, either from a page reload or from a console.clear() call doesn't happen immediately. Instead there can be a race between when contents are logged and when the console is cleared. The end result is that logs go missing! This can be easily demonstrated with code like: ==== <script> console.clear(); console.log("hello world"); </script> ==== The reload case is a little harder to reproduce, but can happen in situations like a local web server or file:/// URL where the page comes in very quickly. If you just have an HTML page like: ==== <script> console.log("hello world"); </script> ==== And hit Command-R a lot of times, you'll probably wind up with a blank console. I've attached these two test cases. This does not affect Chrome.
Attachments
Simple case where command-r to reload may not show console.log (51 bytes, text/html)
2019-12-26 20:50 PST, Jonathan Deutsch
no flags
console.clear and subsequent console.log won't be seen (65 bytes, text/html)
2019-12-26 20:50 PST, Jonathan Deutsch
no flags
Jonathan Deutsch
Comment 1 2019-12-26 20:50:26 PST
Created attachment 386426 [details] Simple case where command-r to reload may not show console.log
Jonathan Deutsch
Comment 2 2019-12-26 20:50:52 PST
Created attachment 386427 [details] console.clear and subsequent console.log won't be seen
Note You need to log in before you can comment on or make changes to this bug.