Bug 263110 - Web Inspector: Better Logging in Sources breakpoint for objects and other types
Summary: Web Inspector: Better Logging in Sources breakpoint for objects and other types
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Safari 17
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-13 00:47 PDT by Karl Dubost
Modified: 2023-10-13 00:48 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2023-10-13 00:47:29 PDT
Let's take this document. 

<p>foo</p>
<script>
var a = document.querySelector('p');
var b = 0;
console.log(a);
</script>


Steps to reproduce
1. Load it in STP 179 for example with "data:text/html,<script…"
2. set a breakpoint on the line starting with var b
3. Choose Log Message in Edit Actions
4. Choose continue after the breakpoint
5. Enter ${a} for the log Message

Result:
When executing a reload, the log message from the breakpoint is 
[Log] [object HTMLParagraphElement]
while console.log(a) is <p>foo</p>


With ${console.log(a)} I get 
[Log] <p>foo</p>
[Log] undefined

With ${console.dir(a)} I get 
[Log] <p> (with an arrow showing all the properties, and the object already opened)
[Log] undefined


I'm not sure which one is the most useful, but 
[object HTMLParagraphElement]
seems to be the less useful. 


Also probably in the other cases the undefined is also not useful.
Comment 1 Radar WebKit Bug Importer 2023-10-13 00:47:39 PDT
<rdar://problem/116907593>
Comment 2 Karl Dubost 2023-10-13 00:48:32 PDT
There is also the case in the dir case on should it be opened or closed by default.