Open Bug 2010643 Opened 10 months ago Updated 10 months ago

Respect the current container when getting page content headlessly

Categories

(Core :: Machine Learning: On Device, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: gregtatum, Unassigned)

References

(Blocks 1 open bug)

Details

If we get page content while in a container, we should do so using the appropriate container so that the cookies and session information is preserved. If it's being pulled from a tab, we should use that tabs container. If we're pulling from the history there is no associated container. Instead we should re-use the current container.

This would likely require funneling through the existing userContextId for the tab in which the fetch is happening, and put it in the setup creating the headless browser. I think for extracting content from an existing tab we don't need to worry and it'll just read content from the open tab (which is already in whatever container it needs to be in). Is that right?

Flags: needinfo?(gtatum)

https://searchfox.org/firefox-main/rev/131497bb1b747587b2b21b1abf14f44ecffad805/browser/components/aiwindow/models/Tools.sys.mjs#356-367

I think this is doing the right thing of using the actor associated with that tab. It's only headlessly when there is no existing tab where this logic needs updating.

Flags: needinfo?(gtatum)
You need to log in before you can comment on or make changes to this bug.