mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-07 00:29:47 +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
|
@ -321,8 +321,8 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
|
|||
|
||||
QObject::connect(focus_location_editor_action, &QAction::triggered, this, &Tab::focus_location_editor);
|
||||
|
||||
view().on_received_source = [this](auto const& url, auto const& source) {
|
||||
auto html = WebView::highlight_source(MUST(url.to_string()), source, Syntax::Language::HTML, WebView::HighlightOutputMode::FullDocument);
|
||||
view().on_received_source = [this](auto const& url, auto const& base_url, auto const& source) {
|
||||
auto html = WebView::highlight_source(url, base_url, source, Syntax::Language::HTML, WebView::HighlightOutputMode::FullDocument);
|
||||
m_window->new_tab_from_content(html, Web::HTML::ActivateTab::Yes);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue