Skip to content

Commit 27aaad6

Browse files
committed
fix!: remove Cookie attribute SameParty (upstream #14545)
Chrome deprecated the sameParty cookie attribute and has been setting it to false internally for years. Upstream Puppeteer dropped it as a breaking change in #14545, so remove the corresponding [Obsolete] property from CookieData/CookieParam and stop forwarding goog:sameParty through the BiDi cookie helpers. BREAKING CHANGE: CookieData.SameParty and CookieParam.SameParty have been removed. Upstream: puppeteer/puppeteer#14545
1 parent 8e11f0b commit 27aaad6

4 files changed

Lines changed: 0 additions & 31 deletions

File tree

lib/PuppeteerSharp.Tests/CookiesTests/SetCookiesTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ await Page.SetCookieAsync(new CookieParam
135135
Value = "123456",
136136
Domain = "localhost",
137137
Path = "/",
138-
#pragma warning disable CS0618 // SameParty is deprecated
139-
SameParty = false,
140-
#pragma warning restore CS0618
141138
Expires = -1,
142139
HttpOnly = false,
143140
Secure = false,

lib/PuppeteerSharp/Bidi/BidiCookieHelper.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,6 @@ public static PartialCookie PuppeteerToBidiCookie(CookieParam cookie, string dom
8484
}
8585

8686
// Add CDP-specific properties if needed
87-
#pragma warning disable CS0618 // SameParty is deprecated
88-
if (cookie.SameParty.HasValue)
89-
{
90-
bidiCookie.AdditionalData["goog:sameParty"] = cookie.SameParty.Value;
91-
}
92-
#pragma warning restore CS0618
93-
9487
if (cookie.SourceScheme.HasValue)
9588
{
9689
bidiCookie.AdditionalData["goog:sourceScheme"] = ConvertSourceSchemeEnumToString(cookie.SourceScheme.Value);
@@ -138,13 +131,6 @@ public static PartialCookie PuppeteerCookieDataToBidiCookie(CookieData cookie, s
138131
bidiCookie.Expires = DateTimeOffset.FromUnixTimeSeconds((long)cookie.Expires.Value).DateTime;
139132
}
140133

141-
#pragma warning disable CS0618 // SameParty is deprecated
142-
if (cookie.SameParty.HasValue)
143-
{
144-
bidiCookie.AdditionalData["goog:sameParty"] = cookie.SameParty.Value;
145-
}
146-
#pragma warning restore CS0618
147-
148134
if (cookie.SourceScheme.HasValue)
149135
{
150136
bidiCookie.AdditionalData["goog:sourceScheme"] = ConvertSourceSchemeEnumToString(cookie.SourceScheme.Value);

lib/PuppeteerSharp/CookieData.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Text.Json.Serialization;
32
using PuppeteerSharp.Helpers.Json;
43

@@ -54,12 +53,6 @@ public class CookieData
5453
/// </summary>
5554
public CookiePriority? Priority { get; set; }
5655

57-
/// <summary>
58-
/// Always set to false. Supported only in Chrome.
59-
/// </summary>
60-
[Obsolete("SameParty is deprecated and always ignored.")]
61-
public bool? SameParty { get; set; }
62-
6356
/// <summary>
6457
/// Cookie source scheme type. Supported only in Chrome.
6558
/// </summary>

lib/PuppeteerSharp/CookieParam.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Text.Json.Serialization;
32
using PuppeteerSharp.Helpers.Json;
43

@@ -82,12 +81,6 @@ public class CookieParam
8281
/// </summary>
8382
public CookiePriority? Priority { get; set; }
8483

85-
/// <summary>
86-
/// Always set to false. Supported only in Chrome.
87-
/// </summary>
88-
[Obsolete("SameParty is deprecated and always ignored.")]
89-
public bool? SameParty { get; set; }
90-
9184
/// <summary>
9285
/// Cookie source scheme type. Supported only in Chrome.
9386
/// </summary>

0 commit comments

Comments
 (0)