mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 23:29:52 +00:00
LibWebView: Generate hyperlinks for attributes that represent links
On the view-source page, generate anchor tags for any 'href' or 'src' attribute value we come across. This handles both when the attribute contains an absolute URL and a URL relative to the page. This requires sending the document's base URL over IPC to resolve relative URLs.
This commit is contained in:
parent
0703ba118b
commit
1aab7b51ea
Notes:
github-actions[bot]
2024-10-20 06:50:51 +00:00
Author: https://github.com/trflynn89
Commit: 1aab7b51ea
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1861
10 changed files with 60 additions and 26 deletions
|
@ -261,11 +261,11 @@ void WebContentClient::did_request_media_context_menu(u64 page_id, Gfx::IntPoint
|
|||
}
|
||||
}
|
||||
|
||||
void WebContentClient::did_get_source(u64 page_id, URL::URL const& url, ByteString const& source)
|
||||
void WebContentClient::did_get_source(u64 page_id, URL::URL const& url, URL::URL const& base_url, String const& source)
|
||||
{
|
||||
if (auto view = view_for_page_id(page_id); view.has_value()) {
|
||||
if (view->on_received_source)
|
||||
view->on_received_source(url, source);
|
||||
view->on_received_source(url, base_url, source);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -720,11 +720,11 @@ void WebContentClient::inspector_did_request_style_sheet_source(u64 page_id, Web
|
|||
}
|
||||
}
|
||||
|
||||
void WebContentClient::did_request_style_sheet_source(u64 page_id, Web::CSS::StyleSheetIdentifier const& identifier, String const& source)
|
||||
void WebContentClient::did_get_style_sheet_source(u64 page_id, Web::CSS::StyleSheetIdentifier const& identifier, URL::URL const& base_url, String const& source)
|
||||
{
|
||||
if (auto view = view_for_page_id(page_id); view.has_value()) {
|
||||
if (view->on_received_style_sheet_source)
|
||||
view->on_received_style_sheet_source(identifier, source);
|
||||
view->on_received_style_sheet_source(identifier, base_url, source);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue