mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
LibWeb: Pass link target to HtmlView's on_link_click callback
This commit is contained in:
parent
95b51e857d
commit
061205b3b3
5 changed files with 5 additions and 4 deletions
|
@ -36,6 +36,7 @@ public:
|
|||
virtual ~HTMLAnchorElement() override;
|
||||
|
||||
String href() const { return attribute("href"); }
|
||||
String target() const { return attribute("target"); }
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
@ -238,7 +238,7 @@ void HtmlView::mousedown_event(GUI::MouseEvent& event)
|
|||
run_javascript_url(link->href());
|
||||
} else {
|
||||
if (on_link_click)
|
||||
on_link_click(link->href());
|
||||
on_link_click(link->href(), link->target());
|
||||
}
|
||||
} else {
|
||||
if (event.button() == GUI::MouseButton::Left) {
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }
|
||||
|
||||
Function<void(const String&)> on_link_click;
|
||||
Function<void(const String& href, const String& target)> on_link_click;
|
||||
Function<void(const String&)> on_link_hover;
|
||||
Function<void(const String&)> on_title_change;
|
||||
Function<void(const URL&)> on_load_start;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue