Copy SessionStorage into windows created with CreateWindowInOtherProcess

Assigned to
(NeedInfo from)



Window Management
2 months ago
2 months ago


(Reporter: mystor, Assigned: mystor, NeedInfo)


Firefox Tracking Flags

(Not tracked)



(4 attachments, 1 obsolete attachment)

We need this right now in order to implement bug 1370971 according to spec, but we would like to not need to do this (see

Let's implement this behind a pref so we can decide what we want.
Created attachment 8877751 [details] [diff] [review]
Copy sessionStorage across processes when opening windows

This patch implements the feature in the simplest way I could think of, which is
using the copy of sessionStorage in sessionstore.

Ideally we'd have a better solution for this.

Doing a try run before I ask for review.

MozReview-Commit-ID: 6f3PMyZSAkd
Created attachment 8878143 [details] [diff] [review]
Part 1: Update the browser_noopener test to also test sessionstorage copying

MozReview-Commit-ID: lvLAfuZYFm
Attachment #8878143 - Flags: review?(bzbarsky)
Attachment #8877751 - Attachment is obsolete: true
Created attachment 8878145 [details] [diff] [review]
Part 2: Add an API to desktop SessionStore to copy SessionStorage between browsers

This was the easiest way I could think of to copy SessionStorage between browsers across processes right now. Baku, I was told you might know things about the future of LocalStorage and SessionStorage, and perhaps you might have an idea of a better/easier way to do this?

Holding off on asking for review on the remaining parts of this bug until I get feedback :).

MozReview-Commit-ID: 2Hfw3SWcLAY
Attachment #8878145 - Flags: feedback?(amarchesini)
Created attachment 8878146 [details] [diff] [review]
Part 3: Use SessionStore to copy SessionStorage in CreateWindowInDifferentProcess

MozReview-Commit-ID: AulvjpdDU5G
Created attachment 8878147 [details] [diff] [review]
Part 4: Enable copying SessionStorage in CreateWindowInDifferentProcess by default

MozReview-Commit-ID: 53U4XvrH0E1
Comment on attachment 8878143 [details] [diff] [review]
Part 1: Update the browser_noopener test to also test sessionstorage copying

r=me, I think.  I assume the test at least fails without these changes and passes with.  ;)
Attachment #8878143 - Flags: review?(bzbarsky) → review+
This actually doesn't work very well (I mess up the loading semantics in part 3, and that means that if we open too many windows at once you can race and fail to open some of them after my changes).

I can probably adapt this patch to make it work (I'd have to probably start the SessionStore flush on the child side before sending the request, and then read it on the parent side, shoving propagating some reference to the SessionStorage information through the Js code which triggers the initial load). It would be awesome if there was a better way to do this, or if we had plans to change SessionStorage already which would make my life easier.
Flags: needinfo?(amarchesini)
Attachment #8878145 - Flags: feedback?(amarchesini)
You need to log in before you can comment on or make changes to this bug.