Open Bug 1921471 Opened 7 months ago Updated 5 months ago

Allow non-parent process sidebar panes in the sidebar

Categories

(Firefox :: Sidebar, task)

Desktop
All
task

Tracking

()

People

(Reporter: Gijs, Assigned: fchasen)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-RCSidebar] )

Attachments

(2 obsolete files)

The sidebar loads a bunch of chrome URLs. This hasn't changed since the pre-e10s/fission days. This is annoying when for more modern code we'd like to use non-parent process frames. Webextensions already work around this by having a single parent-process doc that then has its own nested <browser> element that then shows a content-process webextension document... The double nesting is awkward and seems like something we would ideally get rid of.

There are a bunch of assumptions baked into the code at this point but now that process switching has largely moved into DOM code it doesn't look like fixing this is too awful a job. However, I'm curious about any fundamental problems we might run into when doing something like this; Nika, anything that comes to mind? (e.g. about the number of type=content child frames we expect for browser.xhtml or other assumptions we make)

Flags: needinfo?(nika)

Left some comments on the WIP patch you've posted with some thoughts.

The main thing I expect to break is around the sidebar code now being loaded as a content frame rather than a chrome frame. You mention that previously webextensions have loaded with a nested remote browser within them, and that is not allowed by-default in type=content frames, even within the parent process, so you may need to add more exceptions to https://searchfox.org/mozilla-central/rev/9fa446ad77af13847a7da250135fc58b1a1bd5b9/dom/base/nsFrameLoader.cpp#2601-2613.

Any methods which were handled by directly interacting with the frame will also break, as the frame could be in a separate process, so it seems likely you'll want to add a new messagemanagergroup for the sidebar browser, and move a number of these functions to instead be done over JSWindowActors.

Flags: needinfo?(nika)

(In reply to Nika Layzell [:nika] (ni? for response) from comment #2)

Any methods which were handled by directly interacting with the frame will also break, as the frame could be in a separate process, so it seems likely you'll want to add a new messagemanagergroup for the sidebar browser, and move a number of these functions to instead be done over JSWindowActors.

Mm, well, the contentWindow and contentDocument invocations seem to still work when the contents are in the same process, so as long as we're not changing which process we use (ie which URL we use) to load some of this at the same time, we could tackle this separately. It doesn't look like there's too much logic that cares about the contents, apart from the SidebarFocused thing (which I don't think we need) and the load handling.

Blocks: 1925048
See Also: → 1925048
See Also: 1925048
Attachment #9427774 - Attachment description: Bug 1921471 - use content process to display sidebar contents when appropriate. → WIP: Bug 1921471 - use content process to display sidebar contents when appropriate.
Attachment #9434617 - Attachment is obsolete: true
Attachment #9427774 - Attachment description: WIP: Bug 1921471 - use content process to display sidebar contents when appropriate. → WIP: Bug 1921471 - Use content process to display sidebar contents when appropriate.
Attachment #9427774 - Attachment description: WIP: Bug 1921471 - Use content process to display sidebar contents when appropriate. → Bug 1921471 - Use content process to display sidebar contents when appropriate. r?#shopping-reviewers!,mossop!
Pushed by fchasen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/04f7f20bf82e Use content process to display sidebar contents when appropriate. r=places-reviewers,sidebar-reviewers,mossop,firefox-desktop-core-reviewers ,jsudiaman

Backed out for causing bc failures @browser_syncedtabs_sidebar.js.

Flags: needinfo?(sclements)
Flags: needinfo?(sclements) → needinfo?(fchasen)

Fred, can you hold off on landing this until the 135 Nightly begins on Monday? I'd be good to minimize anything that could cause regressions in 134, since we have a sidebar/vertical tabs experiment continuing in 134.

Thanks Sarah, sorry for rushing to get this in - definitely better to hold off.

Was surprised to see this failing as both tests worked for me when run separately but failed when run back to back. However, I just needed to make sure to call ShoppingSidebar.hide() at the end of the remote test.

Going to make sure to always close sidebars I open in tests now, as browser_syncedtabs_sidebar.js will fail to stub the panel if the view tabs sidebar panel has already been opened in a previous test.

Flags: needinfo?(fchasen)
Pushed by fchasen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c4369fa6e979 Use content process to display sidebar contents when appropriate. r=places-reviewers,sidebar-reviewers,mossop,firefox-desktop-core-reviewers ,jsudiaman
Assignee: gijskruitbosch+bugs → fchasen
Status: NEW → ASSIGNED
Flags: needinfo?(fchasen)
Whiteboard: [fidefe-RCSidebar]
Attachment #9427774 - Attachment is obsolete: true

I've abandoned the patch to update the sidebar to handle remote content, as there are just too many extension sidebar relate tests were failing to get that patch landed without the updating how extensions in the sidebar work.

I still think switching all the sidebar over to remote content is the right approach in the long term. That could be using a single type=content browser or creating a new browser element to load a panel and removing the current browser on hide. To me the later seems consistent with other browser element uses, and may be needed to prevent leaks (or at least to prevent tests from looking like leaks).

However I don't think those are possible to implement without updating how sidebar extensions are loaded at the same time to make it all work together. I'll put together what I think needs to be updated from what I have tried so far so we can try and figure out the size of that project.

Status: ASSIGNED → NEW
No longer blocks: 1916547
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: