[Webkit-unassigned] [Bug 50432] Web Inspector: inline script blocks and injected script elements don't show "scripts" tab list

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 8 07:09:23 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=50432


Kyle Simpson <getify at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |




--- Comment #9 from Kyle Simpson <getify at gmail.com>  2011-02-08 07:09:22 PST ---
I am reopening this bug because I still have two issues with how the Webkit inspector currently handles the scripts.

I made this test URL to illustrate:

http://labjs.com/dev/test_suite/inspector/test-LABjs-sourceURL.php?which=1

1. If you load that page with the Inspector closed, and then open Inspector after it finishes loading the scripts, you'll notice something odd (at least it seems odd to me). If you inspect the DOM, you'll see several script elements, for scripts at URLs like so:

http://labjs.xhr.me/dev/test_suite/testscript3.php?delay=1
[inline script]
http://labjs.xhr.me/dev/test_suite/testscript1.php?delay=5
LAB.test.js

However, if you go to the scripts tab, even though "testscript1.php" and "testscript3.php" were in fact loaded with normal (albeit dynamically added) script elements (not eval or injection), they do NOT show up in the list of scripts. Only "LAB.test.js" shows up in the Script tab list.

However, if you have Inspector open while you load the page, "testscript1.php" and "testscript2.php" ARE listed. Then, as soon as you close Inspector and re-open it, the "testscript1.php" and "testscript3.php" are not listed any more. Clearly, these dynamically added scripts are only shown temporarily in Inspector and not persistently, as would seem the expected behavior.


2. I tried to follow the advice of that firebug article, and patched this copy of LABjs (LAB.test.js) to add the  //@ sourceURL=...  comment to the end of any injected scripts. In this test, "testscript2.php" is loaded via XHR and injected by creating a script element, and setting its .text property.

However, the URL for "testscript2.php" does NOT appear in the Scripts tab list. It would appear that "sourceURL" only works for eval() and not for script injection via .text setting? Or, am I missing something?

You can see in the test that right before it does the script injection, it console.log()'s the last 125 characters of the script its about to inject, and it's definitely including the  //@ sourceURL=... comment at the end of what it injects.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list