summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorFalseHonesty <thefalsehonesty@gmail.com>2020-05-06 15:34:10 -0400
committerAndreas Kling <kling@serenityos.org>2020-05-06 21:59:29 +0200
commit8182a709e3edd50c7bb794409ffac5ea82e4f3d3 (patch)
tree3f738d39d80079b7a29e5f406fdeea0d132471cf /Applications
parent0e048f3c4c9b9ef99b53bd801f0b9763d12d0974 (diff)
downloadserenity-8182a709e3edd50c7bb794409ffac5ea82e4f3d3.zip
Browser: Open links in a new tab when middle clicked
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Browser/Tab.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Applications/Browser/Tab.cpp b/Applications/Browser/Tab.cpp
index 9de3288f2d..fe64cbdae4 100644
--- a/Applications/Browser/Tab.cpp
+++ b/Applications/Browser/Tab.cpp
@@ -165,6 +165,10 @@ Tab::Tab()
m_link_context_menu->popup(screen_position);
};
+ m_html_widget->on_link_middle_click = [this](auto& href) {
+ m_html_widget->on_link_click(href, "_blank", 0);
+ };
+
m_html_widget->on_title_change = [this](auto& title) {
if (title.is_null()) {
m_title = m_html_widget->main_frame().document()->url().to_string();