mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-19 00:31:52 +00:00
LibDevTools+LibWebView+WebContent: Implement getting DOM node inner HTML
This is used by DevTools to copy the inner HTML to the clipboard.
This commit is contained in:
parent
d75eadc3c4
commit
01c44a5c66
Notes:
github-actions[bot]
2025-03-11 13:51:56 +00:00
Author: https://github.com/trflynn89
Commit: 01c44a5c66
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3898
9 changed files with 77 additions and 0 deletions
|
@ -504,6 +504,22 @@ static void edit_dom_node(DevTools::TabDescription const& description, Applicati
|
|||
edit(*view);
|
||||
}
|
||||
|
||||
void Application::get_dom_node_inner_html(DevTools::TabDescription const& description, Web::UniqueNodeID node_id, OnDOMNodeHTMLReceived on_complete) const
|
||||
{
|
||||
auto view = ViewImplementation::find_view_by_id(description.id);
|
||||
if (!view.has_value()) {
|
||||
on_complete(Error::from_string_literal("Unable to locate tab"));
|
||||
return;
|
||||
}
|
||||
|
||||
view->on_received_dom_node_html = [&view = *view, on_complete = move(on_complete)](auto html) {
|
||||
view.on_received_dom_node_html = nullptr;
|
||||
on_complete(html);
|
||||
};
|
||||
|
||||
view->get_dom_node_inner_html(node_id);
|
||||
}
|
||||
|
||||
void Application::get_dom_node_outer_html(DevTools::TabDescription const& description, Web::UniqueNodeID node_id, OnDOMNodeHTMLReceived on_complete) const
|
||||
{
|
||||
auto view = ViewImplementation::find_view_by_id(description.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue