mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:47:35 +00:00
Ladybird+LibWebView: Add an Inspector action to screenshot a DOM node
This commit is contained in:
parent
e3df035c5d
commit
71fdf0860e
7 changed files with 31 additions and 0 deletions
|
@ -171,6 +171,11 @@ static constexpr NSInteger CONTEXT_MENU_COPY_ATTRIBUTE_VALUE_TAG = 3;
|
|||
m_inspector_client->context_menu_copy_dom_node();
|
||||
}
|
||||
|
||||
- (void)screenshotDOMNode:(id)sender
|
||||
{
|
||||
m_inspector_client->context_menu_screenshot_dom_node();
|
||||
}
|
||||
|
||||
- (void)deleteDOMNode:(id)sender
|
||||
{
|
||||
m_inspector_client->context_menu_remove_dom_node();
|
||||
|
@ -240,6 +245,9 @@ static constexpr NSInteger CONTEXT_MENU_COPY_ATTRIBUTE_VALUE_TAG = 3;
|
|||
[_dom_node_tag_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Copy HTML"
|
||||
action:@selector(copyDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
[_dom_node_tag_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Take node screenshot"
|
||||
action:@selector(screenshotDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
}
|
||||
|
||||
return _dom_node_tag_context_menu;
|
||||
|
@ -282,6 +290,9 @@ static constexpr NSInteger CONTEXT_MENU_COPY_ATTRIBUTE_VALUE_TAG = 3;
|
|||
[_dom_node_attribute_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Copy HTML"
|
||||
action:@selector(copyDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
[_dom_node_attribute_context_menu addItem:[[NSMenuItem alloc] initWithTitle:@"Take node screenshot"
|
||||
action:@selector(screenshotDOMNode:)
|
||||
keyEquivalent:@""]];
|
||||
}
|
||||
|
||||
return _dom_node_attribute_context_menu;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue