Browser+LibWeb+WebContent: Track the source of document.cookie requests

To implement the HttpOnly attribute, the CookieJar needs to know where a
request originated from. Namely, it needs to distinguish between HTTP /
non-HTTP (i.e. JavaScript) requests. When the HttpOnly attribute is set,
requests from JavaScript are to be blocked.
This commit is contained in:
Timothy Flynn 2021-04-13 17:30:41 -04:00 committed by Andreas Kling
commit c00760c5f9
Notes: sideshowbarker 2024-07-18 20:22:16 +09:00
20 changed files with 54 additions and 47 deletions

View file

@ -70,8 +70,8 @@ public:
Function<void(const URL&)> on_tab_open_request;
Function<void(Tab&)> on_tab_close_request;
Function<void(const Gfx::Bitmap&)> on_favicon_change;
Function<String(const URL& url)> on_get_cookie;
Function<void(const URL& url, const String& cookie)> on_set_cookie;
Function<String(const URL& url, Web::Cookie::Source source)> on_get_cookie;
Function<void(const URL& url, const String& cookie, Web::Cookie::Source source)> on_set_cookie;
Function<void()> on_dump_cookies;
const String& title() const { return m_title; }