Closed Bug 914930 Opened 11 years ago Closed 11 years ago

load source content via Debugger.Source

Categories

(DevTools :: Debugger, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: fitzgen, Assigned: fitzgen)

References

Details

Attachments

(1 file)

So there are lots of things we will be able to do when we fully embrace Debugger.Source, but in the meantime, we should stop making HTTP requests to load sources and just use Debugger.Source.prototype.text.
Priority: P3 → P2
Comment on attachment 803404 [details] [diff] [review]
bug-914930-debugger-source-text.patch

Review of attachment 803404 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.

::: toolkit/devtools/server/actors/script.js
@@ +3614,5 @@
>     *        The generated source url that introduced this source via source map,
>     *        if any.
> +   * @param optional String text
> +   *        The text content of the source, if immediately available.
> +   * @param optional String text

s/text/contentType/

@@ +3659,5 @@
> +    // source is an HTML-embedded <script> tag. Since we don't have an API
> +    // implemented to detect whether this is the case, we need to be
> +    // conservative and only use Debugger.Source.prototype.text if we get a
> +    // normal .js file.
> +    if (aScript.url && aScript.url.endsWith(".js")) {

This is OK, but a tad too conservative. It misses URLs that contain request parameters for instance. If you parse it using nsIURL you can get to the fileName part easily (see trimUrl in debugger-panes.js).
Attachment #803404 - Flags: review?(past) → review+
https://hg.mozilla.org/mozilla-central/rev/a79989ddb366
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 26
This change breaks the Browser Debugger. Can't backout due to tree closure and imminent uplift, but I think that's the proper course of action here, unless we can quickly fix the problem.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Eddy is looking into bug 916845, so let's give him a day or so to see if he can quickly come up with a fix.
Eddy got a fix in (although he is still working on tests as a follow up).
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: