Open
Bug 868378
Opened 11 years ago
Updated 2 years ago
Break on page load
Categories
(DevTools :: Debugger, enhancement, P3)
DevTools
Debugger
Tracking
(Not tracked)
NEW
People
(Reporter: msucan, Unassigned)
References
(Blocks 1 open bug)
Details
A web developer told me she is having a really hard time debugging why some JavaScript library she was working with loads the wrong page on button click. She couldn't debug the scripts because the codebase was new to her and she couldn't find which function triggers the wrong load - apparently the event handler she added wasn't event triggered. She later learned that the page had an unrelated event handler which broke things. Similar use-cases would be easier to debug if we had an option to break JS execution when a page load is requested. Like break on event or break on exception, you would see why a page load has been triggered.
Comment 1•11 years ago
|
||
Implementing this will be tricky without support for watchpoints, since intercepting the load using an event would present the stack in a new turn of the event loop, with the original call missing.
Comment 2•11 years ago
|
||
if we could inject our on onload handler we might be able to fake this. Would be super-useful to have.
Priority: -- → P3
Comment 4•10 years ago
|
||
Exposing this in the frontend could be as easy as adding a "Pause on navigation" in the debugger's gear menu. There are many stages in a navigation though. We could break when the currently debugged page unloads. Or the next page loads. Or before it loads. Or... I think the most useful use-case that we should support is pausing on what we call "will-navigate", so basically when the current target starts reloading/ navigating away.
Comment 5•10 years ago
|
||
How about adding it in the debugger's events tab.
Comment 6•10 years ago
|
||
The events tab lists handlers present in the page, so copying the break-on-error UI seems better in this case. I'm still not sure if pausing in the progress listener will have content frames in the stack, which is what both comment 0 and bug 977261 actually need.
Comment 7•10 years ago
|
||
Any news about this?
Updated•10 years ago
|
Summary: Add an option to break on page load → Break on page load
Updated•10 years ago
|
Blocks: dbg-control
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•5 years ago
|
Type: defect → enhancement
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•