diff --git a/Ladybird/Qt/Tab.cpp b/Ladybird/Qt/Tab.cpp index 83538c99fbe..055cacfc5e0 100644 --- a/Ladybird/Qt/Tab.cpp +++ b/Ladybird/Qt/Tab.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include @@ -217,13 +217,8 @@ Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path, WebView:: QObject::connect(focus_location_editor_action, &QAction::triggered, this, &Tab::focus_location_editor); view().on_received_source = [this](auto const& url, auto const& source) { - auto* text_edit = new QPlainTextEdit(this); - text_edit->setWindowFlags(Qt::Window); - text_edit->setFont(QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)); - text_edit->resize(800, 600); - text_edit->setWindowTitle(qstring_from_ak_deprecated_string(url.to_deprecated_string())); - text_edit->setPlainText(qstring_from_ak_deprecated_string(source)); - text_edit->show(); + auto html = WebView::highlight_source(url, source); + m_window->new_tab(html, url, Web::HTML::ActivateTab::Yes); }; view().on_navigate_back = [this]() {