1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

Ladybird: Hook up the CookieJar again after WebContent introduction

This commit is contained in:
Andreas Kling 2022-10-11 10:53:28 +02:00 committed by Andrew Kaster
parent 775332e179
commit 71dadabfaa
2 changed files with 12 additions and 1 deletions

View file

@ -159,7 +159,7 @@ BrowserWindow::BrowserWindow()
dump_cookies_action->setIcon(QIcon(QString("%1/res/icons/browser/cookie.png").arg(s_serenity_resource_root.characters())));
debug_menu->addAction(dump_cookies_action);
QObject::connect(dump_cookies_action, &QAction::triggered, this, [this] {
debug_request("dump-cookies");
m_cookie_jar.dump_cookies();
});
auto* dump_local_storage_action = new QAction("Dump Local Storage", this);
@ -295,6 +295,14 @@ void BrowserWindow::new_tab()
QObject::connect(tab_ptr, &Tab::title_changed, this, &BrowserWindow::tab_title_changed);
QObject::connect(tab_ptr, &Tab::favicon_changed, this, &BrowserWindow::tab_favicon_changed);
tab_ptr->view().on_get_cookie = [this](auto& url, auto source) -> String {
return m_cookie_jar.get_cookie(url, source);
};
tab_ptr->view().on_set_cookie = [this](auto& url, auto& cookie, auto source) {
m_cookie_jar.set_cookie(url, cookie, source);
};
tab_ptr->focus_location_editor();
}