mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:47:46 +00:00
Ladybird+LibWebView: Add an Inspector action to copy a node's HTML/text
This commit is contained in:
parent
51a0673b5c
commit
e3df035c5d
7 changed files with 55 additions and 0 deletions
|
@ -166,6 +166,11 @@ static constexpr NSInteger CONTEXT_MENU_COPY_ATTRIBUTE_VALUE_TAG = 3;
|
|||
m_inspector_client->context_menu_edit_dom_node();
|
||||
}
|
||||
|
||||
- (void)copyDOMNode:(id)sender
|
||||
{
|
||||
m_inspector_client->context_menu_copy_dom_node();
|
||||
}
|
||||
|
||||
- (void)deleteDOMNode:(id)sender
|
||||
{
|
||||
m_inspector_client->context_menu_remove_dom_node();
|
||||
|
@ -196,6 +201,9 @@ static constexpr NSInteger CONTEXT_MENU_COPY_ATTRIBUTE_VALUE_TAG = 3;
|
|||
[_dom_node_text_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Edit text"
|
||||
action:@selector(editDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
[_dom_node_text_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Copy text"
|
||||
action:@selector(copyDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
|
||||
[_dom_node_text_context_menu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
|
@ -226,6 +234,12 @@ static constexpr NSInteger CONTEXT_MENU_COPY_ATTRIBUTE_VALUE_TAG = 3;
|
|||
[_dom_node_tag_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Delete node"
|
||||
action:@selector(deleteDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
|
||||
[_dom_node_tag_context_menu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
[_dom_node_tag_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Copy HTML"
|
||||
action:@selector(copyDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
}
|
||||
|
||||
return _dom_node_tag_context_menu;
|
||||
|
@ -262,6 +276,12 @@ static constexpr NSInteger CONTEXT_MENU_COPY_ATTRIBUTE_VALUE_TAG = 3;
|
|||
[_dom_node_attribute_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Delete node"
|
||||
action:@selector(deleteDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
|
||||
[_dom_node_attribute_context_menu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
[_dom_node_attribute_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Copy HTML"
|
||||
action:@selector(copyDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
}
|
||||
|
||||
return _dom_node_attribute_context_menu;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue