mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-07 08:39:43 +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
|
@ -432,7 +432,7 @@ void ConnectionFromClient::get_source(u64 page_id)
|
|||
{
|
||||
if (auto page = this->page(page_id); page.has_value()) {
|
||||
if (auto* doc = page->page().top_level_browsing_context().active_document())
|
||||
async_did_get_source(page_id, doc->url(), doc->source().to_byte_string());
|
||||
async_did_get_source(page_id, doc->url(), doc->base_url(), doc->source());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -644,9 +644,8 @@ void ConnectionFromClient::request_style_sheet_source(u64 page_id, Web::CSS::Sty
|
|||
return;
|
||||
|
||||
if (auto* document = page->page().top_level_browsing_context().active_document()) {
|
||||
auto stylesheet = document->get_style_sheet_source(identifier);
|
||||
if (stylesheet.has_value())
|
||||
async_did_request_style_sheet_source(page_id, identifier, stylesheet.value());
|
||||
if (auto stylesheet = document->get_style_sheet_source(identifier); stylesheet.has_value())
|
||||
async_did_get_style_sheet_source(page_id, identifier, document->base_url(), stylesheet.value());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue