load source content via Debugger.Source

RESOLVED FIXED in Firefox 26

Status

()

Firefox
Developer Tools: Debugger
P2
normal
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: fitzgen, Assigned: fitzgen)

Tracking

unspecified
Firefox 26
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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.
Blocks: 833744
Created attachment 803404 [details] [diff] [review]
bug-914930-debugger-source-text.patch

https://tbpl.mozilla.org/?tree=Try&rev=1c49f5d25bc3
Attachment #803404 - Flags: review?(past)
Priority: P3 → P2
Blocks: 762761
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/integration/fx-team/rev/a79989ddb366
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/a79989ddb366
Status: ASSIGNED → RESOLVED
Last Resolved: 4 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 → ---
Depends on: 916845
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
Last Resolved: 4 years ago4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.