From 680e15b68618ac30b50b178bf1999b9b980da3b2 Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Fri, 20 Nov 2026 23:12:01 +0300 Subject: [PATCH] ref(cookies): remove sameparty? and same_party?, Chrome dropped SameParty cookies --- CHANGELOG.md | 1 + lib/ferrum/cookies/cookie.rb | 11 ----------- spec/cookies/cookie_spec.rb | 7 ------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbc772e6..236998bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -119,6 +119,7 @@ - `Ferrum::ServerError`, nothing raised it - `:browser_name`, it only switched between Chrome-named defaults and raised `NotImplementedError` for anything else, set `:browser_path` to run Opera or Edge +- `cookie.sameparty?` and `same_party?`, Chrome dropped SameParty cookies and they always returned `nil` ## [0.20.2](https://github.com/rubycdp/ferrum/compare/v0.20.1...v0.20.2) (November 19, 2026) ## diff --git a/lib/ferrum/cookies/cookie.rb b/lib/ferrum/cookies/cookie.rb index bad3480c..4e5f23d6 100644 --- a/lib/ferrum/cookies/cookie.rb +++ b/lib/ferrum/cookies/cookie.rb @@ -122,17 +122,6 @@ def priority @attributes["priority"] end - # - # Specifies whether the cookie is a first-party set cookie or not. - # - # @return [Boolean] - # - def sameparty? - @attributes["sameParty"] - end - - alias same_party? sameparty? - # # The scheme (`"Unset"`, `"NonSecure"`, `"Secure"`) that the cookie was set with. # diff --git a/spec/cookies/cookie_spec.rb b/spec/cookies/cookie_spec.rb index 02e0cedb..c2086207 100644 --- a/spec/cookies/cookie_spec.rb +++ b/spec/cookies/cookie_spec.rb @@ -14,7 +14,6 @@ "secure" => false, "session" => false, "priority" => "Medium", - "sameParty" => false, "sourceScheme" => "Secure", "sourcePort" => 443 } @@ -96,12 +95,6 @@ end end - describe "#sameparty?" do - it "returns the 'sameParty' attribute" do - expect(subject.sameparty?).to eq(attributes["sameParty"]) - end - end - describe "#source_scheme" do it "returns the 'sourceScheme' attribute" do expect(subject.source_scheme).to eq(attributes["sourceScheme"])