File tree 3 files changed +9
-0
lines changed
toolkit/components/windowwatcher
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ enum class ExplicitActiveStatus : uint8_t {
123
123
FIELD (Muted, bool ) \
124
124
/* See nsSandboxFlags.h for the possible flags. */ \
125
125
FIELD (SandboxFlags, uint32_t ) \
126
+ /* The value of SandboxFlags when the BrowsingContext is first created. \
127
+ * Used for sandboxing the initial about:blank document. */ \
126
128
FIELD (InitialSandboxFlags, uint32_t ) \
127
129
/* A non-zero unique identifier for the browser element that is hosting \
128
130
* this \
Original file line number Diff line number Diff line change @@ -301,6 +301,11 @@ void CanonicalBrowsingContext::ReplacedBy(
301
301
txn.SetHistoryID (GetHistoryID ());
302
302
txn.SetExplicitActive (GetExplicitActive ());
303
303
txn.SetHasRestoreData (GetHasRestoreData ());
304
+ // As this is a different BrowsingContext, set InitialSandboxFlags to the
305
+ // current flags in the new context so that they also apply to any initial
306
+ // about:blank documents created in it.
307
+ txn.SetSandboxFlags (GetSandboxFlags ());
308
+ txn.SetInitialSandboxFlags (GetSandboxFlags ());
304
309
if (aNewContext->EverAttached ()) {
305
310
MOZ_ALWAYS_SUCCEEDS (txn.Commit (aNewContext));
306
311
} else {
Original file line number Diff line number Diff line change @@ -1021,6 +1021,8 @@ nsresult nsWindowWatcher::OpenWindowInternal(
1021
1021
SANDBOX_PROPAGATES_TO_AUXILIARY_BROWSING_CONTEXTS) {
1022
1022
MOZ_ASSERT (windowIsNew, " Should only get here for new windows" );
1023
1023
MOZ_ALWAYS_SUCCEEDS (newBC->SetSandboxFlags (activeDocsSandboxFlags));
1024
+ MOZ_ALWAYS_SUCCEEDS (
1025
+ newBC->SetInitialSandboxFlags (newBC->GetSandboxFlags ()));
1024
1026
}
1025
1027
1026
1028
RefPtr<nsGlobalWindowOuter> win (
You can’t perform that action at this time.
0 commit comments