The default bug view has changed. See this FAQ.

Status

()

Firefox
Developer Tools: Debugger
P2
normal
ASSIGNED
4 years ago
4 days ago

People

(Reporter: vporof, Assigned: zer0)

Tracking

(Depends on: 1 bug, Blocks: 3 bugs)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [polish-backlog])

Comment hidden (empty)
(Reporter)

Comment 1

4 years ago
We need a way to break on XHR requests (POST, GET, etc.)
take a look at firebug's implementation. Or we could ask Honza!

filter on BLACKEAGLE.
Priority: -- → P2
(Reporter)

Comment 3

4 years ago
Honza, how do you do this? Can you point us at the relevant code in Firebug?
Flags: needinfo?(odvarko)
1) First you need to handle "http-on-opening-request" (nsIObserver). Note that it was "http-on-opening-request" in the past (Fx 16), but that event is not synchronous anymore (see https://bugzilla.mozilla.org/show_bug.cgi?id=800799)

Here is where Firebug does it:
https://github.com/firebug/firebug/blob/master/extension/content/firebug/net/netMonitor.js#L404

2) As soon as the handler is executed (synchronously), the debugger needs to check if there is an enabled breakpoint and associated with the URL.

https://github.com/firebug/firebug/blob/master/extension/content/firebug/net/netProgress.js#L224

3) If there is a breakpoint, optional condition needs to be evaluated. The condition should be able to deal at least with URL params and post data.

https://github.com/firebug/firebug/blob/master/extension/content/firebug/net/netProgress.js#L229

4) If the breakpoint says: "break", the debugger needs the interrupt JS execution synchronously (to keep the current stack trace).

https://github.com/firebug/firebug/blob/master/extension/content/firebug/net/netProgress.js#L256

5) Consequently, the debugger needs to peel off the stack trace and keep only frames coming from the content (web page).

Up to now all happens on the server side. Now, the server should just send 'pause' event to the client and the client should handle it just like it handles other interrupts...

See this posts for UX info:
http://www.softwareishard.com/blog/firebug/firebug-tip-conditional-breakpoints/
http://www.softwareishard.com/blog/firebug/firebug-15-xhr-breakpoints/


Honza
Flags: needinfo?(odvarko)
(Reporter)

Comment 5

4 years ago
This is excellent! Thanks!
(In reply to Jan Honza Odvarko from comment #4)
> 1) First you need to handle "http-on-opening-request" (nsIObserver). Note
> that it was "http-on-opening-request" in the past (Fx 16), but that event is
> not synchronous anymore (see
Just a little correction, it was "http-on-modify-request" in the past...

Honza
(Reporter)

Updated

4 years ago
Assignee: nobody → vporof
Status: NEW → ASSIGNED
(Reporter)

Comment 7

4 years ago
Filed bug 832983.
(Reporter)

Updated

4 years ago
Depends on: 832983
(Reporter)

Comment 8

3 years ago
It doesn't look like I'll be working on this in the near future. Unassigning, for now.
Assignee: vporof → nobody
Status: ASSIGNED → NEW

Updated

3 years ago
Summary: Break on XHR → Break on XHR (frontend)

Updated

3 years ago
Summary: Break on XHR (frontend) → Break on XHR

Updated

3 years ago
Blocks: 1074488

Updated

2 years ago
Whiteboard: [devedition-40]
Whiteboard: [devedition-40] → [polish-backlog]
I've just created bug 1267144 and didn't see that there is already a bug for this.
Now I'm wondering whether this bug is meant for implementing the 'Break On XHR' button, i.e. break on any XHR, or for implementing the single XHR breakpoints, i.e. break on a specific XHR, or both.

Victor, can you please clarify that, so I know what to do with bug 1267144?

Sebastian
Flags: needinfo?(vporof)

Updated

11 months ago
Blocks: 991806

Updated

11 months ago
See Also: → bug 1267144
Because Victor doesn't answer, Honza, can you please answer my question from comment 9?

Sebastian
Flags: needinfo?(vporof) → needinfo?(odvarko)
It isn't clear from the original report, but I think that this report should cover entire Break on XHR feature. The UI/UI requirements might change when somebody is actually working on this and so, any followups should be filed when we have more analysis.

@Sebastian, please close bug 1267144.

Honza
Flags: needinfo?(odvarko) → needinfo?(sebastianzartner)
Duplicate of this bug: 1267144
Flags: needinfo?(sebastianzartner)
Blocks: 1267303
(Assignee)

Updated

4 days ago
Assignee: nobody → zer0
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.