mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
Browser+LibWeb: Add hooks for getting and setting cookies
This commit is contained in:
parent
f0cdb2bf50
commit
e54837add5
4 changed files with 26 additions and 0 deletions
|
@ -242,6 +242,17 @@ Tab::Tab(Type type)
|
|||
on_favicon_change(icon);
|
||||
};
|
||||
|
||||
hooks().on_get_cookie = [this](auto& url) -> String {
|
||||
if (on_get_cookie)
|
||||
return on_get_cookie(url);
|
||||
return {};
|
||||
};
|
||||
|
||||
hooks().on_set_cookie = [this](auto& url, auto& cookie) {
|
||||
if (on_set_cookie)
|
||||
on_set_cookie(url, cookie);
|
||||
};
|
||||
|
||||
hooks().on_get_source = [this](auto& url, auto& source) {
|
||||
view_source(url, source);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue