Bug 166777 - Can't put a breakpoint inside minified script in the main resource
Summary: Can't put a breakpoint inside minified script in the main resource
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-01-06 14:41 PST by Simon Fraser (smfr)
Modified: 2017-01-06 16:24 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2017-01-06 14:41:24 PST
I'm trying to debug http://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=iPad%20pro&rsv_pq=e5e15bc5000304ba&rsv_t=89d6S0vXYIEqJKQ54HBscceCoq%2BvT94MX%2BpYLhaPExeuOii5Ir8cNoZuy9E&rqlang=cn&rsv_enter=1&rsv_sug3=9&rsv_sug2=0&inputT=1035&rsv_sug4=1035 on the iPad simulator, and would like to put a breakpoint on the code "$dom_headBlock.hide()" in the main document. However, I can't because this is never unmagnified.
Comment 1 Simon Fraser (smfr) 2017-01-06 14:41:35 PST
^unminified
Comment 2 Radar WebKit Bug Importer 2017-01-06 14:46:21 PST
<rdar://problem/29908995>
Comment 3 Joseph Pecoraro 2017-01-06 14:49:11 PST
Possible solutions:

1. Preferred: Pretty Print HTML content
2. Half Way: Pretty Print at least <script> in HTML content
3. Always Useful: Right Click + Set Breakpoint at Exact Location

I'm sure we have other bugs for (1).

But I'd like to use this for (3) which should be pretty easy to do and has applicability even with Pretty Printed code!

For example if you wanted to set a breakpoint inside of something that is not broken up across multiple lines even when pretty printed.

Here is an arbitrary examples off the top of my head, deciding to pause inside of a default argument expression.

    function add(a, b = (() => |x + b))() {
        ...
    }

This is a rather weird case that would be hard to pause in otherwise (you'd have to pause at the caller of add and step to get into it otherwise.
Comment 4 Simon Fraser (smfr) 2017-01-06 14:52:00 PST
I don't think I would have discovered 3).

Also it would be super hard to step through minified JS, so I'm not sure it makes sense to allow breakpoints in the middle of a long line.
Comment 5 Joseph Pecoraro 2017-01-06 16:24:49 PST
(In reply to comment #4)
> Also it would be super hard to step through minified JS, so I'm not sure it
> makes sense to allow breakpoints in the middle of a long line.

Stepping through minified JS should be much better now that we highlight exactly what expression / statement is about to execute. If we have issues there I can address them as well.