script tag using sourceURL doesn't appear in debugger sources pane
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
People
(Reporter: juangj, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
Updated•9 years ago
|
Comment 1•9 years ago
|
||
Comment 2•9 years ago
|
||
Comment 3•9 years ago
|
||
Comment 4•9 years ago
|
||
Updated•8 years ago
|
Comment 5•8 years ago
|
||
Updated•8 years ago
|
Comment 7•8 years ago
|
||
Updated•8 years ago
|
Comment 8•8 years ago
|
||
Updated•8 years ago
|
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Updated•6 years ago
|
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
David, this sounds like the debugger works for you? Is that correct? If not, could you let me know what's not working?
Comment 15•6 years ago
|
||
Sorry if I wasn't clear. What's not working is that when you write code that dynamically references code in another file, normally the debugger will fail to list that other file in the list of source files until it is actually referenced. A great solution would be to recognize a pragma to add a file to the list of source files. This is just what pragmas are for: to indicate information that cannot be calculated lexically by the debugger. This is a variant of the undecidability of the Halting Problem (https://en.wikipedia.org/wiki/Halting_problem).
Updated•6 years ago
|
Comment 16•5 years ago
|
||
This is what I'm seeing. It is missing one of the eval'd scripts
Updated•5 years ago
|
Comment 17•5 years ago
|
||
(In reply to David Spector from comment #12)
(https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/
Debug_eval_sources) contains a clear syntax error. It writes the pragma by
example as "//# sourceURL=my-foo.js`;" Note the lone accent grave just
before the semicolon.
I copied the code from MDN and it works for me.
(In reply to David Spector from comment #13)
Okay, I figured it out. When you are simulating a JavaScript Include, the
included script will be in a variable. Step 1: In your app code, write a
separate statement like "eval(IncludedScript);" so you can put a breakpoint
on it. Step 2: In the Include file put a statement like the following at the
very beginning: "//# sourceURL=FTAdjust.js". In this case, the Include file
is FTAdjust.js. Note that there is no semicolon on the pragma. Step 3:
reload your app, turn on the debugger, and put a breakpoint in the code that
uses the simulated Include statement on the eval line. Step 4: Run your app
so the simulated Include statement is executed. It will hit the breakpoint.
Step 5: Step in then step over to begin stepping through your eval code.
Note that the file name now shows up in the Sources pane.Okay, so I didn't see the same bug as is reported here. But I did provide
everyone with a useful debugging ability, yes?
Please file another report for this + a test case we can use to reproduce on our machines.
The original bug is fixed in new Debugger UI and I am closing this report.
Honza
Updated•5 years ago
|
Comment 18•5 years ago
|
||
Honza, Thanks for your request for another report and a test case, but I have given up on my Webextensions programming after having too much frustration with its needless inter-process programming complications and difficulty in debugging. I truly am happy never to return to my attempt to write a simple Firefox extension.
Comment 19•5 years ago
|
||
(In reply to David Spector from comment #18)
Honza, Thanks for your request for another report and a test case, but I have given up on my Webextensions programming after having too much frustration with its needless inter-process programming complications and difficulty in debugging. I truly am happy never to return to my attempt to write a simple Firefox extension.
I see, thanks for quick response!
Honza
Description
•