mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 23:17:44 +00:00
LibWeb: Open subframe links inside the subframe itself
We now only delegate to the Web::PageView embedded when clicking links in the main frame. Links in subframes are handled internally.
This commit is contained in:
parent
d1852b4547
commit
747b21782e
1 changed files with 6 additions and 1 deletions
|
@ -132,7 +132,12 @@ bool EventHandler::handle_mousedown(const Gfx::Point& position, unsigned button,
|
|||
if (href.starts_with("javascript:")) {
|
||||
document.run_javascript(href.substring_view(11, href.length() - 11));
|
||||
} else {
|
||||
page_view.notify_link_click({}, m_frame, link->href(), link->target(), modifiers);
|
||||
if (m_frame.is_main_frame()) {
|
||||
page_view.notify_link_click({}, m_frame, link->href(), link->target(), modifiers);
|
||||
} else {
|
||||
// FIXME: Handle different targets!
|
||||
m_frame.loader().load(document.complete_url(link->href()));
|
||||
}
|
||||
}
|
||||
} else if (button == GUI::MouseButton::Right) {
|
||||
page_view.notify_link_context_menu_request({}, m_frame, position, link->href(), link->target(), modifiers);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue