Browser: Implement pasting Web data to the clipboard

This commit is contained in:
Timothy Flynn 2023-11-10 13:53:34 -05:00 committed by Andreas Kling
parent 306850652f
commit 9421ffd4ec
Notes: sideshowbarker 2024-07-17 02:39:10 +09:00

View file

@ -620,6 +620,10 @@ Tab::Tab(BrowserWindow& window)
on_tab_close_request(*this); 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 = GUI::Menu::construct();
m_tab_context_menu->add_action(GUI::CommonActions::make_reload_action([this](auto&) { m_tab_context_menu->add_action(GUI::CommonActions::make_reload_action([this](auto&) {
reload(); reload();