summaryrefslogtreecommitdiff
path: root/Ladybird/BrowserWindow.cpp
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2023-01-08 15:01:26 +0100
committerLinus Groh <mail@linusgroh.de>2023-01-19 19:22:03 +0000
commit194ddca24f600b6dc080c41fc19b2d42bcb86239 (patch)
treedf3d043114d3c825e9a68022d34beb1d4db133c2 /Ladybird/BrowserWindow.cpp
parent5e8977393735203cbf40e317e14f8ce61c2206f9 (diff)
downloadserenity-194ddca24f600b6dc080c41fc19b2d42bcb86239.zip
Ladybird: Move the initial blank page load to BrowserWindow
Takes care of a FIXME :^)
Diffstat (limited to 'Ladybird/BrowserWindow.cpp')
-rw-r--r--Ladybird/BrowserWindow.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Ladybird/BrowserWindow.cpp b/Ladybird/BrowserWindow.cpp
index 6f9e588398..35956d8fca 100644
--- a/Ladybird/BrowserWindow.cpp
+++ b/Ladybird/BrowserWindow.cpp
@@ -366,6 +366,14 @@ void BrowserWindow::new_tab()
};
tab_ptr->focus_location_editor();
+
+ // This is a hack to make the JS console usable in new windows.
+ // Note we *don't* load the initial page if we are connected to a WebDriver, as the Set URL command may come in very
+ // quickly, and become replaced by this load.
+ if (m_webdriver_content_ipc_path.is_empty()) {
+ // We make it HistoryNavigation so that the initial page doesn't get added to the history.
+ tab_ptr->navigate("about:blank", Tab::LoadType::HistoryNavigation);
+ }
}
void BrowserWindow::close_tab(int index)