From 9421ffd4ecb1df907354ec3d8ff8fac06a43b626 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 10 Nov 2023 13:53:34 -0500 Subject: [PATCH] Browser: Implement pasting Web data to the clipboard --- Userland/Applications/Browser/Tab.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 69e81e9ecd..727c29a1ed 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -620,6 +620,10 @@ Tab::Tab(BrowserWindow& window) on_tab_close_request(*this); }; + view().on_insert_clipboard_entry = [](auto const& data, auto const&, auto const& mime_type) { + GUI::Clipboard::the().set_data(data.bytes(), mime_type.to_deprecated_string()); + }; + m_tab_context_menu = GUI::Menu::construct(); m_tab_context_menu->add_action(GUI::CommonActions::make_reload_action([this](auto&) { reload();