1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

Ladybird+LibWebView: Add an Inspector action to copy an attribute value

This commit is contained in:
Timothy Flynn 2023-12-06 10:12:31 -05:00 committed by Andreas Kling
parent f7de1369d2
commit 51a0673b5c
7 changed files with 51 additions and 1 deletions

View file

@ -268,6 +268,17 @@ void InspectorClient::context_menu_remove_dom_node_attribute()
m_context_menu_data.clear();
}
void InspectorClient::context_menu_copy_dom_node_attribute_value()
{
VERIFY(m_context_menu_data.has_value());
VERIFY(m_context_menu_data->attribute.has_value());
if (m_content_web_view.on_insert_clipboard_entry)
m_content_web_view.on_insert_clipboard_entry(m_context_menu_data->attribute->value, "unspecified"_string, "text/plain"_string);
m_context_menu_data.clear();
}
void InspectorClient::load_inspector()
{
StringBuilder builder;

View file

@ -30,6 +30,7 @@ public:
void context_menu_remove_dom_node();
void context_menu_add_dom_node_attribute();
void context_menu_remove_dom_node_attribute();
void context_menu_copy_dom_node_attribute_value();
Function<void(Gfx::IntPoint)> on_requested_dom_node_text_context_menu;
Function<void(Gfx::IntPoint, String const&)> on_requested_dom_node_tag_context_menu;