mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
LibWeb: Make the link click hooks include the destination URL
We have all the context needed for relative URL resolution inside the engine, so let's not make embedders worry about this.
This commit is contained in:
parent
1037a24076
commit
02c5e22f06
6 changed files with 23 additions and 24 deletions
|
@ -154,12 +154,10 @@ Tab::Tab()
|
|||
update_bookmark_button(url.to_string());
|
||||
};
|
||||
|
||||
m_page_view->on_link_click = [this](auto& href, auto& target, unsigned modifiers) {
|
||||
m_page_view->on_link_click = [this](auto& url, auto& target, unsigned modifiers) {
|
||||
if (target == "_blank" || modifiers == Mod_Ctrl) {
|
||||
auto url = m_page_view->document()->complete_url(href);
|
||||
on_tab_open_request(url);
|
||||
} else {
|
||||
auto url = m_page_view->document()->complete_url(href);
|
||||
m_page_view->load(url);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue