mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibWeb: Fix js execution for js urls in anchor tags href
This commit is contained in:
parent
1a10e904b5
commit
0eac8bce6f
Notes:
sideshowbarker
2024-07-17 01:46:43 +09:00
Author: https://github.com/PrestonLTaylor
Commit: 0eac8bce6f
Pull-request: https://github.com/SerenityOS/serenity/pull/19658
4 changed files with 38 additions and 17 deletions
|
@ -286,7 +286,7 @@ bool EventHandler::handle_mouseup(CSSPixelPoint position, unsigned button, unsig
|
|||
dbgln("Web::EventHandler: Clicking on a link to {}", url);
|
||||
if (button == GUI::MouseButton::Primary) {
|
||||
if (href.starts_with("javascript:"sv)) {
|
||||
document->run_javascript(href.substring_view(11, href.length() - 11));
|
||||
document->navigate_to_javascript_url(href);
|
||||
} else if (!url.fragment().is_null() && url.equals(document->url(), AK::URL::ExcludeFragment::Yes)) {
|
||||
m_browsing_context->scroll_to_anchor(url.fragment());
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue