mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
Ladybird: Hook up the CookieJar again after WebContent introduction
This commit is contained in:
parent
775332e179
commit
71dadabfaa
Notes:
sideshowbarker
2024-07-17 06:35:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/71dadabfaa Pull-request: https://github.com/SerenityOS/serenity/pull/16583 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "CookieJar.h"
|
||||
#include "Tab.h"
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <LibCore/Forward.h>
|
||||
|
@ -45,4 +46,6 @@ private:
|
|||
QTabWidget* m_tabs_container { nullptr };
|
||||
NonnullOwnPtrVector<Tab> m_tabs;
|
||||
Tab* m_current_tab { nullptr };
|
||||
|
||||
Browser::CookieJar m_cookie_jar;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue