File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,9 @@ export function bidiToCdpCookie(
227227 httpOnly : params . cookie . httpOnly ?? false ,
228228 ...( partitionKey . sourceOrigin !== undefined && {
229229 partitionKey : {
230- hasCrossSiteAncestor : false ,
230+ hasCrossSiteAncestor : Boolean (
231+ partitionKey [ 'goog:hasCrossSiteAncestor' ]
232+ ) ,
231233 // CDP's `partitionKey.topLevelSite` is the BiDi's `partition.sourceOrigin`.
232234 topLevelSite : partitionKey . sourceOrigin ,
233235 } ,
Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ export class StorageProcessor {
7777 // are returned.
7878 ( c ) =>
7979 partitionKey . sourceOrigin === undefined ||
80- c . partitionKey ?. topLevelSite === partitionKey . sourceOrigin
80+ ( c . partitionKey ?. topLevelSite === partitionKey . sourceOrigin &&
81+ c . partitionKey ?. hasCrossSiteAncestor ===
82+ partitionKey [ 'goog:hasCrossSiteAncestor' ] )
8183 )
8284 . filter ( ( cdpCookie ) => {
8385 const bidiCookie = cdpToBiDiCookie ( cdpCookie ) ;
@@ -212,7 +214,12 @@ export class StorageProcessor {
212214 if (
213215 key !== undefined &&
214216 value !== undefined &&
215- ! [ 'type' , 'sourceOrigin' , 'userContext' ] . includes ( key )
217+ ! [
218+ 'type' ,
219+ 'sourceOrigin' ,
220+ 'userContext' ,
221+ 'goog:hasCrossSiteAncestor' ,
222+ ] . includes ( key )
216223 ) {
217224 unsupportedPartitionKeys . set ( key , value ) ;
218225 }
@@ -229,10 +236,13 @@ export class StorageProcessor {
229236
230237 // Set `userContext` to `default` if not provided, as it's required in Chromium.
231238 const userContext = descriptor . userContext ?? 'default' ;
239+ const hasCrossSiteAncestor =
240+ descriptor [ 'goog:hasCrossSiteAncestor' ] ?? false ;
232241
233242 return {
234243 userContext,
235244 ...( sourceOrigin === undefined ? { } : { sourceOrigin} ) ,
245+ ...( sourceOrigin === undefined ? { } : { 'goog:hasCrossSiteAncestor' : hasCrossSiteAncestor } ) ,
236246 } ;
237247 }
238248
You can’t perform that action at this time.
0 commit comments