Open Bug 1333400 Opened 8 years ago Updated 2 years ago

Get devtools.network.onNavigated working in the case of frame switching

Categories

(WebExtensions :: Developer Tools, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: bsilverberg, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [devtools]triaged)

When working on the initial implementation of devtools.network.onNavigated, I found that the devtools tabNavigated event was not firing when switching the focus of the devtools panel from the main document to an iframe inside the main document. I'm not sure why this is happening, and Luca feels that we should be notifying browser.devtools.network.onNavigated when the focus switches between frames, so we need to address this via this bug. Alexandre, do you know why I might not be getting notification of tabNavigated when switching between frames? I tried listening on the frameUpdate event as well, but that didn't seem to fire when switching between frames either. FTR, I am using the button with the id of `command-button-frames` to switch between frames, just doing a manual test for now to see if anything fires. If you have any advice on this I would appreciate it.
Flags: needinfo?(poirot.alex)
I do see frameUpdate event being fired on client. Here is how you could listen for that: (frameUpdate client event is mapped to frame-updated on the target) target.on("frame-update", (_, event) => { if (event.selected) { // Only consider event with event.selected attribute, // frame-update is also fired when an iframe is created/destroyed/updated // when event.selected is set it means we selected an iframe as new target for tools // event.selected is going to be the outer window ID of the selected iframe document. } });
Flags: needinfo?(poirot.alex)
No longer blocks: 1211859
Product: Toolkit → WebExtensions
Assignee: bob.silverberg → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.