Closed Bug 1306029 Opened 8 years ago Closed 5 years ago

Unable to show inline JS source in data URI document

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: ato, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When putting an inline script inside a data URI, devtools is unable to show the source in the ‘Source’ pane in the ‘Debugger’ tab.

A sample URI is data:text/html;charset=utf-8,%3Cscript%3E%0D%0Aconsole.log("first line")%3B%0D%0Aconsole.log("second line")%3B%0D%0A%3C%2Fscript%3E, which contains to lines of JavaScript:

    <script>
    console.log("first line");
    console.log("second line");
    </script>

Interestingly, if you add a `debugger` statement in there, it _will_ stop and show you the source:

    <script>
    console.log("first line");
    debugger;
    console.log("second line");
    </script>

Data URI of last example:

data:text/html;charset=utf-8,%3Cscript%3E%0D%0Aconsole.log("first line")%3B%0D%0Adebugger%3B%0D%0Aconsole.log("second line")%3B%0D%0A%3C%2Fscript%3E

I recommend using http://software.hixie.ch/utilities/cgi/data/data when working on this.
I do see the script, but it shows up in the page's markup as a source.  This is the same behavior for when a script tag is embedded in an html page.  This might be feature request to make inline script tags get listed as separate scripts in the sources list, but I don't think that's specific to data URIs
Component: Developer Tools → Developer Tools: Debugger
Attached image data-uri-debugger.png
What I see when I open data:text/html,<script>console.log("first line");console.log("second line");</script> in a tab.  Note the UI is different with the new debugger frontend but it's the same basic thing.
Priority: -- → P3
Product: Firefox → DevTools

Honza, could you verify?

Flags: needinfo?(odvarko)

This might be feature request to make inline script tags get listed as separate scripts in the sources list,
but I don't think that's specific to data URIs

Since it isn't related to data URIs and I can see the script source in the Sources tree, I am closing the report.
Feel free to file a feature request for improving the Sources tree structure.

Honza

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(odvarko)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: