1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 03:57:35 +00:00

LibWeb: Add window.sessionStorage

This commit is contained in:
Paul Wratt 2022-03-08 04:39:44 +13:00 committed by Linus Groh
parent 1535fe0324
commit 83eb5ac8fd
4 changed files with 21 additions and 0 deletions

View file

@ -528,6 +528,17 @@ RefPtr<HTML::Storage> Window::local_storage()
});
}
// https://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage
RefPtr<HTML::Storage> Window::session_storage()
{
// FIXME: Implement according to spec.
static HashMap<Origin, NonnullRefPtr<HTML::Storage>> session_storage_per_origin;
return session_storage_per_origin.ensure(associated_document().origin(), [] {
return HTML::Storage::create();
});
}
// https://html.spec.whatwg.org/multipage/browsers.html#dom-parent
Window* Window::parent()
{