1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

Browser: Add storage inspector to context menu

This commit is contained in:
Rafał Babiarz 2022-03-01 17:11:03 +01:00 committed by Andreas Kling
parent c2e2a964f2
commit 6bf59cbb1b

View file

@ -228,6 +228,14 @@ void BrowserWindow::build_menus()
js_console_action->set_status_tip("Open JavaScript console for this page"); js_console_action->set_status_tip("Open JavaScript console for this page");
inspect_menu.add_action(js_console_action); inspect_menu.add_action(js_console_action);
auto storage_window_action = GUI::Action::create(
"Open S&torage Inspector", g_icon_bag.cookie, [this](auto&) {
active_tab().show_storage_inspector();
},
this);
storage_window_action->set_status_tip("Show Storage inspector for this page");
inspect_menu.add_action(storage_window_action);
auto& settings_menu = add_menu("&Settings"); auto& settings_menu = add_menu("&Settings");
m_change_homepage_action = GUI::Action::create( m_change_homepage_action = GUI::Action::create(
@ -526,6 +534,10 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
m_cookie_jar.dump_cookies(); m_cookie_jar.dump_cookies();
}; };
new_tab.on_want_cookies = [this]() {
return m_cookie_jar.get_all_cookies();
};
new_tab.load(url); new_tab.load(url);
dbgln_if(SPAM_DEBUG, "Added new tab {:p}, loading {}", &new_tab, url); dbgln_if(SPAM_DEBUG, "Added new tab {:p}, loading {}", &new_tab, url);