mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:17:34 +00:00
Browser: Introduce action for opening bookmarks in a new window
This change introduces an action to bookmarks that allows them to be opened in a new browser window. This is done by accessing any bookmark's context menu and pressing "Open in New Window".
This commit is contained in:
parent
abad197884
commit
1dddefa737
6 changed files with 32 additions and 11 deletions
|
@ -109,7 +109,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
|
|||
};
|
||||
|
||||
m_window_actions.on_create_new_window = [this] {
|
||||
GUI::Process::spawn_or_show_error(this, "/bin/Browser"sv);
|
||||
create_new_window(g_home_url);
|
||||
};
|
||||
|
||||
m_window_actions.on_next_tab = [this] {
|
||||
|
@ -583,6 +583,10 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
|
|||
});
|
||||
};
|
||||
|
||||
new_tab.on_window_open_request = [this](auto& url) {
|
||||
create_new_window(url);
|
||||
};
|
||||
|
||||
new_tab.on_get_all_cookies = [this](auto& url) {
|
||||
return m_cookie_jar.get_all_cookies(url);
|
||||
};
|
||||
|
@ -631,6 +635,11 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
|
|||
m_tab_widget->set_active_widget(&new_tab);
|
||||
}
|
||||
|
||||
void BrowserWindow::create_new_window(URL url)
|
||||
{
|
||||
GUI::Process::spawn_or_show_error(this, "/bin/Browser"sv, Array { url.to_deprecated_string() });
|
||||
}
|
||||
|
||||
void BrowserWindow::content_filters_changed()
|
||||
{
|
||||
tab_widget().for_each_child_of_type<Browser::Tab>([](auto& tab) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue