Bug 143577 - Web Inspector: breakpoints set in IIFE closures via GUI do not fire
Summary: Web Inspector: breakpoints set in IIFE closures via GUI do not fire
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-04-09 14:21 PDT by Joey Korkames
Modified: 2016-12-13 15:35 PST (History)
4 users (show)

See Also:


Attachments
script for editing individual resources in webarchives (1.60 KB, text/plain)
2015-04-09 14:22 PDT, Joey Korkames
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joey Korkames 2015-04-09 14:21:36 PDT
Occasionally I need to tear into readonly remote-hosted JS code to isolate and report bugs on webapps I use.

Single-page-application sites now commonly enclose their entire app code into an IIFE, adding nothing to the global scope that can be probed using the console.
  (function () { true; }() )
or
  !function(){ true; }()

Web Inspector will let me click to set breakpoints inside IIFEs but they will never fire when the site feature that was breakpointed is engaged.
Breakpointing the same lines in Chrome, Opera and Firefox works and provides console access to the stack inside the IIFE closure.

It makes no difference whether the script file was minified (and subsequently prettified by Web Inspector) or not.
None of the sites I am debugging have source-maps available.

The only way I can currently debug such sites on Safari is by saving a WebArchive and manually editing scripts' WebResourceData to insert `debugger;` statements: webarchive-vim is a python script I wrote to streamline this.
Comment 1 Radar WebKit Bug Importer 2015-04-09 14:21:55 PDT
<rdar://problem/20488898>
Comment 2 Joey Korkames 2015-04-09 14:22:49 PDT
Created attachment 250467 [details]
script for editing individual resources in webarchives