Closed Bug 1643540 Opened 28 days ago Closed 26 days ago

Finding the type of a Debugger.Source loaded from a <script> is too hard


(DevTools :: Debugger, enhancement)



(firefox79 fixed)

Firefox 79
Tracking Status
firefox79 --- fixed


(Reporter: loganfsmyth, Assigned: loganfsmyth)


(Blocks 1 open bug)



(1 file)

The debugger exposes "introductionType" as a field to know what generic type a source is. Currently "scriptElement" is used for anything loaded via <script> directly. What that means is that we have to jump through a bunch of hoops to differentiate:

  • JS scripts loaded from <script src="file.js"></script>
  • JS scripts inlined directly into HTML <script>code;</script>
  • JS scripts injected into HTML via document.write, or doc.createElement

We currently jump through hoops to differentiate these using source.element and source.introductionScript, but there's essentially no reason for us to do that in a perfect world, and it allows for much more reliable behavior.

The lack of specificity for script intro type has lead the debugger to need
to make use of 'source.introductionType' and 'source.element' in order to
determine whether a given script was injected, or inline or fetched, which
is entirely unnecessary of the loader itself clearly tells us what type
of script we are working with. It also allows us to cleanly handle the case
of XUL, which previously was "scriptElement" but has no ".element" passed
in, so we were unable to know whether a given source was inline or not.

Assignee: nobody → loganfsmyth
Attachment #9154433 - Attachment description: Bug 1643540 - Provide separate introductionTypes for different types of sources. r=jlast! → Bug 1643540 - Split scriptElement type into three types for clarity. r=jlast!
Pushed by
Split scriptElement type into three types for clarity. r=jlast,smaug
Closed: 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
Regressions: 1644075
See Also: → 1644075
You need to log in before you can comment on or make changes to this bug.