Closed
Bug 1252077
Opened 9 years ago
Closed 9 years ago
Source text of Scratchpad sources fails to load in the browser debugger.
Categories
(DevTools :: Debugger, defect, P2)
DevTools
Debugger
Tracking
(firefox47 fixed)
RESOLVED
FIXED
Firefox 47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: ejpbruel, Assigned: ejpbruel)
Details
Attachments
(1 file, 1 obsolete file)
1.27 KB,
patch
|
jlong
:
review+
|
Details | Diff | Splinter Review |
In the browser debugger, when you click on a Scratchpad source in the sources view, the source text fails to load. The reason is that Scratchpad sources use a bogus url, and we try to fetch the source text from this url.
We should instead fetch this from the text property on the corresponding Debugger.Source object, but we only do so for sources where we can identify the content type as JavaScript. If the source has a URL, we use that to make this determination, by looking at the extension. However, scratchpad sources don't have an extension, so we erroneously assume that they are not JavaScript.
There are two possible solutions here. We have a number of special cases in the debugger for special URLS. We could add another special case there for scratchpad URLs. However, I don't like adding special case code, especially if that code depends on the behavior of another tool that is not obvious unless you already know.
The other option is simply to add a ".js" extension to the URLs generated by the scratchpad. This will allow the debugger to correctly identify them as JavaScript sources.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ejpbruel
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8724729 -
Flags: review?(nfitzgerald)
Updated•9 years ago
|
Attachment #8724729 -
Flags: review?(nfitzgerald) → review+
Assignee | ||
Comment 2•9 years ago
|
||
Try run for this patch:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7e74806882cb
Assignee | ||
Comment 3•9 years ago
|
||
I just realised that this patch won't work, because event with a .js extension, Scratchpad URLs are still not valid URLs, and the debugger only checks the extension of URLs that it can parse. It looks like the best course of action is to add a special case for Scratchpad URLs in the debugger, after all :-(
Assignee | ||
Updated•9 years ago
|
Component: Developer Tools: Scratchpad → Developer Tools: Debugger
Assignee | ||
Comment 4•9 years ago
|
||
See the bug description and comment 3 for an explanation of this patch.
Attachment #8724729 -
Attachment is obsolete: true
Attachment #8725241 -
Flags: review?(jlong)
Assignee | ||
Comment 5•9 years ago
|
||
Try run for the above patch:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=08c77f63fb29
Assignee | ||
Updated•9 years ago
|
Priority: -- → P2
Comment 6•9 years ago
|
||
Comment on attachment 8725241 [details] [diff] [review]
The debugger should identify the content type of Scratchpad sources as JavaScript.
Review of attachment 8725241 [details] [diff] [review]:
-----------------------------------------------------------------
Yeah, this solution works for me. Not ideal but it just a tiny check.
Attachment #8725241 -
Flags: review?(jlong) → review+
Assignee | ||
Comment 7•9 years ago
|
||
Try push for this patch:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6a5e5b6ad949
Assignee | ||
Comment 8•9 years ago
|
||
Try push looks messy, but afaict, these are either known issues not related to this patch, or infra failures.
Comment 10•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Comment 11•9 years ago
|
||
It appears Bug 813087, Bug 816988 and Bug 1168560 can also be marked as FIXED. I'm happy that it's now finally possible to debug scratchpads, although a couple of issues that make it slightly inconvenient remain:
1. The Debugger window doesn't appear automatically when running a Scratchpad script as expected if Dev Tools are closed but the code has either a `debugger;` statement or a breakpoint previously set in Debugger.
2. Debugger doesn't refresh a Scratchpad script's source code after the script is rerun with some changes without refreshing the current page.
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•