summaryrefslogtreecommitdiff
path: root/Userland/Services/WebContent
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-28 11:24:04 -0500
committerAndreas Kling <kling@serenityos.org>2022-12-08 17:14:48 +0100
commitbf060adcf973b3f1017f4ce4679816f4be589f9b (patch)
tree47304dc4575c44e81ba3fb22f21a5eb7f0d73b8a /Userland/Services/WebContent
parent949f5460fb8ab73512b7f721cee99440fa956e56 (diff)
downloadserenity-bf060adcf973b3f1017f4ce4679816f4be589f9b.zip
Browser+LibWebView+WebContent: Do not domain match on cookie updates
Updating cookies through these hooks happens in one of two manners: 1. Through the Browser's storage inspector. 2. Through WebDriver's delete-cookies operation. In (1), we should not restrict ourselves to being able to delete cookies for the current page. For example, it's handy to open the inspector from the welcome page and be able to delete cookies for any domain. In (2), we already are only interacting with cookies that have been matched against the document URL.
Diffstat (limited to 'Userland/Services/WebContent')
-rw-r--r--Userland/Services/WebContent/PageHost.cpp4
-rw-r--r--Userland/Services/WebContent/PageHost.h2
-rw-r--r--Userland/Services/WebContent/WebContentClient.ipc2
-rw-r--r--Userland/Services/WebContent/WebDriverConnection.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp
index 4bbafade65..4f5a83c303 100644
--- a/Userland/Services/WebContent/PageHost.cpp
+++ b/Userland/Services/WebContent/PageHost.cpp
@@ -359,9 +359,9 @@ void PageHost::page_did_set_cookie(const URL& url, Web::Cookie::ParsedCookie con
m_client.async_did_set_cookie(url, cookie, static_cast<u8>(source));
}
-void PageHost::page_did_update_cookie(URL const& url, Web::Cookie::Cookie cookie)
+void PageHost::page_did_update_cookie(Web::Cookie::Cookie cookie)
{
- m_client.async_did_update_cookie(url, move(cookie));
+ m_client.async_did_update_cookie(move(cookie));
}
void PageHost::page_did_update_resource_count(i32 count_waiting)
diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h
index 7aeca9d20b..ad494c05f8 100644
--- a/Userland/Services/WebContent/PageHost.h
+++ b/Userland/Services/WebContent/PageHost.h
@@ -92,7 +92,7 @@ private:
virtual Optional<Web::Cookie::Cookie> page_did_request_named_cookie(URL const&, DeprecatedString const&) override;
virtual DeprecatedString page_did_request_cookie(const URL&, Web::Cookie::Source) override;
virtual void page_did_set_cookie(const URL&, Web::Cookie::ParsedCookie const&, Web::Cookie::Source) override;
- virtual void page_did_update_cookie(URL const&, Web::Cookie::Cookie) override;
+ virtual void page_did_update_cookie(Web::Cookie::Cookie) override;
virtual void page_did_update_resource_count(i32) override;
virtual void request_file(NonnullRefPtr<Web::FileRequest>&) override;
diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc
index 6f5af5ee37..455377b83c 100644
--- a/Userland/Services/WebContent/WebContentClient.ipc
+++ b/Userland/Services/WebContent/WebContentClient.ipc
@@ -43,7 +43,7 @@ endpoint WebContentClient
did_request_named_cookie(URL url, DeprecatedString name) => (Optional<Web::Cookie::Cookie> cookie)
did_request_cookie(URL url, u8 source) => (DeprecatedString cookie)
did_set_cookie(URL url, Web::Cookie::ParsedCookie cookie, u8 source) =|
- did_update_cookie(URL url, Web::Cookie::Cookie cookie) =|
+ did_update_cookie(Web::Cookie::Cookie cookie) =|
did_update_resource_count(i32 count_waiting) =|
did_request_restore_window() =|
did_request_reposition_window(Gfx::IntPoint position) => (Gfx::IntPoint window_position)
diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp
index dd5a46d144..94bc6990d7 100644
--- a/Userland/Services/WebContent/WebDriverConnection.cpp
+++ b/Userland/Services/WebContent/WebDriverConnection.cpp
@@ -1752,7 +1752,7 @@ void WebDriverConnection::delete_cookies(Optional<StringView> const& name)
if (!name.has_value() || name.value() == cookie.name) {
// Set the cookie expiry time to a Unix timestamp in the past.
cookie.expiry_time = Core::DateTime::from_timestamp(0);
- m_page_client.page_did_update_cookie(document->url(), move(cookie));
+ m_page_client.page_did_update_cookie(move(cookie));
}
// -> Otherwise
// Do nothing.