Open Bug 1991928 Opened 2 months ago Updated 1 month ago

Devtools support for Navigation API

Categories

(DevTools :: Debugger, enhancement, P2)

enhancement

Tracking

(Not tracked)

People

(Reporter: zcorpan, Unassigned)

References

(Blocks 2 open bugs)

Details

There should be at least support for breakpoints for the new events on window.navigation (maybe under "Load" or maybe a new category "Navigation").

  • navigate
  • navigatesuccess
  • navigateerror
  • currententrychange

I don't know if there are other things that should be supported in devtools for the Navigation API.

Perhaps a way to inspect the session history with Jake diagrams?

I'm guessing Simon meant this to go to Devtools, feel free to toss it back if I misunderstood.

Component: Developer Tools → Performance Tools (Profiler/Timeline)
Product: WebExtensions → DevTools

I think "Debugger" component is more correct for this, considering that it's about supporting for breakpoints.

Component: Performance Tools (Profiler/Timeline) → Debugger
Severity: -- → S3
Priority: -- → P2

Is there a handy example page out there where we could easily test and practice the navigation API and its related events?

It may also help us see if we could do more than just breakpoints.

Jake, you told me about having tools to help debug/inspect/understand the session history. Do you have some UI/UX in mind?

Flags: needinfo?(jaffathecake)

Hi! Sorry for the delay in replying, I was away last week.

Yes, an ideal devtool would be a timeline for the session history of the tab. https://html.spec.whatwg.org/multipage/document-sequences.html#jake-diagrams - 'Jake diagrams' were the best thing I came up with when trying to document this stuff in the spec.

Something that has step numbers across the top, like Jake-diagrams, then rows for the top level and each of the frames.

When inspecting a session history entry (one of the items in the rows), it should provide the session history entry data, as in:

  • URL
  • History API state
  • Navigation API state
  • Navigation API key
  • Navigation API ID
  • Nice to have: Scroll restoration mode & scroll position data
  • Document state (see below)

Ideally it should be easy to spot when a single document state is used contiguously across multiple session history entries (as in, same document navigations). Hilariously, it is possible for the same document to be used by two non-contiguous history entries, but it's… I think… rare in practice. For document state:

  • State of the document: active, bf-cached, evicted.
  • If evicted, reason for eviction (for debugging bf-cachability)
  • If there's a 'resource' (eg POST body) associated with this document
  • Nice to haves: Referrer, referrer policy, history policy

It'd be nice to be able to navigate directly to a history step.

If any of this isn't clear, I can try and provide more details, or jump on a call.

Flags: needinfo?(jaffathecake)

The above is good for capturing the current state of session history, but it might be handy to have a log for session history mutations.

Eg, logs like:

  • URL & history API state changed for step 4, frame[0][1], via history.replaceState()
  • Steps 5, 6, 7 removed due to push navigation from step 4 within frame[1]. New step 5 created.
You need to log in before you can comment on or make changes to this bug.