LibWeb+LibWebView: Implement emitting CookieChangeEvents

This commit is contained in:
Idan Horowitz 2025-08-07 18:20:13 +03:00 committed by Tim Flynn
parent a72a0b3c2d
commit 81e3afd1fd
Notes: github-actions[bot] 2025-08-08 17:11:07 +00:00
7 changed files with 213 additions and 1 deletions

View file

@ -24,6 +24,7 @@
#include <LibWeb/CSS/ComputedProperties.h>
#include <LibWeb/CSS/Parser/ErrorReporter.h>
#include <LibWeb/CSS/StyleComputer.h>
#include <LibWeb/CookieStore/CookieStore.h>
#include <LibWeb/DOM/Attr.h>
#include <LibWeb/DOM/CharacterData.h>
#include <LibWeb/DOM/Document.h>
@ -1314,4 +1315,14 @@ void ConnectionFromClient::system_time_zone_changed()
Unicode::clear_system_time_zone_cache();
}
void ConnectionFromClient::cookies_changed(Vector<Web::Cookie::Cookie> cookies)
{
for (auto& navigable : Web::HTML::all_navigables()) {
auto window = navigable->active_window();
if (!window)
return;
window->cookie_store()->process_cookie_changes(cookies);
}
}
}

View file

@ -156,6 +156,7 @@ private:
virtual void paste(u64 page_id, String text) override;
virtual void system_time_zone_changed() override;
virtual void cookies_changed(Vector<Web::Cookie::Cookie>) override;
NonnullOwnPtr<PageHost> m_page_host;

View file

@ -128,4 +128,5 @@ endpoint WebContentServer
set_user_style(u64 page_id, String source) =|
system_time_zone_changed() =|
cookies_changed(Vector<Web::Cookie::Cookie> cookies) =|
}