Open Bug 1014940 Opened 11 years ago Updated 2 years ago

Proxying some URLs for fixing code.

Categories

(DevTools :: Debugger, enhancement, P3)

30 Branch
x86
macOS
enhancement

Tracking

(Not tracked)

People

(Reporter: karlcow, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Scenario: Debugging a Web site when you do not have authoritative access on the original site. In the debugger it should be possible to select a JavaScript URI currently loaded and to replace it with another script (be on your local machine or inside a new script context inside the debugger view). At the next reload, instead of requesting the cache version or refetching the resource online, it will get the local script. This would enable to work on debugging the script, still keeping the original. I created a visual mockup for what it could be. I'm pretty sure there are better ways to show it. See the attachment see the line with autocomplete.js (which would be my local JS.) Maybe it needs a checkbox to activate deactivate it.
See also http://www.whatcouldbewrong.com/articles/4/the-mysteriously-disappearing-youtube-search-string for the kitchen sink necessary to do this kind of thing now.
This is similar to bug 771339, which is our long-term plan for facilitating JS editing. Did you know that you could use Scratchpad for exploratory debugging in similar cases, with live function replacement (http://fitzgeraldnick.com/weblog/52/)? Would that be a workable solution for you?
(In reply to Panos Astithas [:past] from comment #2) > This is similar to bug 771339, which is our long-term plan for facilitating > JS editing. Would those edits survive reloads? IMO that's a requirement. > Did you know that you could use Scratchpad for exploratory > debugging in similar cases, with live function replacement > (http://fitzgeraldnick.com/weblog/52/)? Would that be a workable solution > for you? I haven't even tested Scratchpad yet (sorry), but quoting the page you linked to "allows you to evaluate individual top level functions" - sorry, but evaluating top-level functions is something I can already do pasting code in the console, and pretty much any real web app has tons of scopes and closures. So if Scratchpad is limited to top-level functions it's not yet very helpful. I do full-file-replacement debugging with Fiddler HTTP debugger quite a lot. A native solution right there in the debugger would be great. Live function editing with scopes/closures kept would also be excellent if you could somehow make the edited functions survive re-load and perhaps have a UI where the edits can be toggled on/off like breakpoints..
(In reply to Hallvord R. M. Steen from comment #3) > (In reply to Panos Astithas [:past] from comment #2) > > This is similar to bug 771339, which is our long-term plan for facilitating > > JS editing. > > Would those edits survive reloads? IMO that's a requirement. I am pretty sure that is the plan, but no work has yet started on it, so its really early to quote what it can/can't do > > Did you know that you could use Scratchpad for exploratory > > debugging in similar cases, with live function replacement > > (http://fitzgeraldnick.com/weblog/52/)? Would that be a workable solution > > for you? > > I haven't even tested Scratchpad yet (sorry), but quoting the page you > linked to "allows you to evaluate individual top level functions" - sorry, > but evaluating top-level functions is something I can already do pasting > code in the console, and pretty much any real web app has tons of scopes and > closures. So if Scratchpad is limited to top-level functions it's not yet > very helpful. > > I do full-file-replacement debugging with Fiddler HTTP debugger quite a lot. > A native solution right there in the debugger would be great. Live function > editing with scopes/closures kept would also be excellent if you could > somehow make the edited functions survive re-load and perhaps have a UI > where the edits can be toggled on/off like breakpoints.. From the same page : "editing your code in the Scratchpad and using Cmd + E to re-evaluate individual functions. Re-evaluating individual functions doesn't refresh the app, and lets it maintain its existing state" This means you can "re-evaluate" any method, not just "evaluate" top level methods.
Product: Firefox → DevTools

I believe there is an addon for doing this now? CC Harald

Type: defect → enhancement
Flags: needinfo?(hkirschner)
Priority: -- → P3

Yes, Karl is using it afaik: https://github.com/arai-a/ditm

I am not sure if this should be in Debugger or Network. I am in favor of closing this in favor of bug 771339 in combination with the Track Changes (bug 1429247) functionality.

Flags: needinfo?(hkirschner)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: