Skip to content

Commit 36b716c

Browse files
committed
rename
1 parent 5f51f87 commit 36b716c

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

packages/playwright-core/src/protocol/validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ scheme.SetNetworkCookie = tObject({
137137
secure: tOptional(tBoolean),
138138
sameSite: tOptional(tEnum(['Strict', 'Lax', 'None'])),
139139
partitionKey: tOptional(tString),
140-
_chromiumHasCrossSiteAncestor: tOptional(tBoolean),
140+
_crHasCrossSiteAncestor: tOptional(tBoolean),
141141
});
142142
scheme.NetworkCookie = tObject({
143143
name: tString,
@@ -149,7 +149,7 @@ scheme.NetworkCookie = tObject({
149149
secure: tBoolean,
150150
sameSite: tEnum(['Strict', 'Lax', 'None']),
151151
partitionKey: tOptional(tString),
152-
_chromiumHasCrossSiteAncestor: tOptional(tBoolean),
152+
_crHasCrossSiteAncestor: tOptional(tBoolean),
153153
});
154154
scheme.NameValue = tObject({
155155
name: tString,

packages/playwright-core/src/server/chromium/crBrowser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ export class CRBrowserContext extends BrowserContext {
396396
// this is Chromium specific, see https://chromestatus.com/feature/5144832583663616
397397
// and https://github.com/explainers-by-googlers/CHIPS-spec.
398398
if (c.partitionKey) {
399-
copy._chromiumHasCrossSiteAncestor = c.partitionKey.hasCrossSiteAncestor;
399+
copy._crHasCrossSiteAncestor = c.partitionKey.hasCrossSiteAncestor;
400400
copy.partitionKey = c.partitionKey.topLevelSite;
401401
}
402402
return copy;
@@ -405,7 +405,7 @@ export class CRBrowserContext extends BrowserContext {
405405

406406
async addCookies(cookies: channels.SetNetworkCookie[]) {
407407
function toChromiumCookie(cookie: channels.SetNetworkCookie) {
408-
const { name, value, url, domain, path, expires, httpOnly, secure, sameSite, partitionKey, _chromiumHasCrossSiteAncestor } = cookie;
408+
const { name, value, url, domain, path, expires, httpOnly, secure, sameSite, partitionKey, _crHasCrossSiteAncestor } = cookie;
409409
const copy: Protocol.Network.CookieParam = {
410410
name,
411411
value,
@@ -420,8 +420,8 @@ export class CRBrowserContext extends BrowserContext {
420420
if (partitionKey) {
421421
copy.partitionKey = {
422422
topLevelSite: partitionKey,
423-
// _chromiumHasCrossSiteAncestor is non-standard, set it true by default if the cookie is partitioned.
424-
hasCrossSiteAncestor: _chromiumHasCrossSiteAncestor ?? true,
423+
// _crHasCrossSiteAncestor is non-standard, set it true by default if the cookie is partitioned.
424+
hasCrossSiteAncestor: _crHasCrossSiteAncestor ?? true,
425425
};
426426
}
427427
return copy;

packages/protocol/src/channels.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export type SetNetworkCookie = {
261261
secure?: boolean,
262262
sameSite?: 'Strict' | 'Lax' | 'None',
263263
partitionKey?: string,
264-
_chromiumHasCrossSiteAncestor?: boolean,
264+
_crHasCrossSiteAncestor?: boolean,
265265
};
266266

267267
export type NetworkCookie = {
@@ -274,7 +274,7 @@ export type NetworkCookie = {
274274
secure: boolean,
275275
sameSite: 'Strict' | 'Lax' | 'None',
276276
partitionKey?: string,
277-
_chromiumHasCrossSiteAncestor?: boolean,
277+
_crHasCrossSiteAncestor?: boolean,
278278
};
279279

280280
export type NameValue = {

packages/protocol/src/protocol.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ SetNetworkCookie:
224224
- Lax
225225
- None
226226
partitionKey: string?
227-
_chromiumHasCrossSiteAncestor: boolean?
227+
_crHasCrossSiteAncestor: boolean?
228228

229229

230230
NetworkCookie:
@@ -244,7 +244,7 @@ NetworkCookie:
244244
- Lax
245245
- None
246246
partitionKey: string?
247-
_chromiumHasCrossSiteAncestor: boolean?
247+
_crHasCrossSiteAncestor: boolean?
248248

249249

250250
NameValue:

tests/library/browsercontext-cookies-third-party.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ test(`add 'Partitioned;' cookie via API`, async ({ page, context, browserName, h
330330
secure: true,
331331
sameSite: 'None',
332332
partitionKey: 'https://localhost',
333-
_chromiumHasCrossSiteAncestor: false
333+
_crHasCrossSiteAncestor: false
334334
} as any,
335335
{
336336
name: 'top-level-non-partitioned',
@@ -352,7 +352,7 @@ test(`add 'Partitioned;' cookie via API`, async ({ page, context, browserName, h
352352
secure: true,
353353
sameSite: 'None',
354354
partitionKey: 'https://127.0.0.1',
355-
_chromiumHasCrossSiteAncestor: true
355+
_crHasCrossSiteAncestor: true
356356
} as any,
357357
{
358358
name: 'frame-non-partitioned',

0 commit comments

Comments
 (0)