mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Remove exit for javascript urls in anchor activation_behavior()
This early return is no longer needed because Navigable::navigate() can process `javascript:` urls. Fixes https://github.com/SerenityOS/serenity/issues/22052
This commit is contained in:
parent
80d1c93edf
commit
afe24883b7
Notes:
sideshowbarker
2024-07-16 23:05:02 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/afe24883b7 Pull-request: https://github.com/SerenityOS/serenity/pull/22054 Issue: https://github.com/SerenityOS/serenity/issues/22052
3 changed files with 15 additions and 5 deletions
|
@ -0,0 +1 @@
|
|||
link clicked!
|
|
@ -0,0 +1,14 @@
|
|||
<script src="include.js"></script>
|
||||
<script>
|
||||
function javascript_navigation_callback() {
|
||||
println("link clicked!");
|
||||
window.done();
|
||||
}
|
||||
</script>
|
||||
<a id="test-link" href="javascript:javascript_navigation_callback()"></a>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
document.getElementById("test-link").click();
|
||||
window.done = done;
|
||||
});
|
||||
</script>
|
|
@ -57,11 +57,6 @@ void HTMLAnchorElement::activation_behavior(Web::DOM::Event const&)
|
|||
if (href().is_empty())
|
||||
return;
|
||||
|
||||
// AD-HOC: follow_the_hyperlink currently doesn't navigate properly with javascript urls
|
||||
// EventHandler::handle_mouseup performs the navigation steps for javascript urls instead
|
||||
if (href().starts_with_bytes("javascript:"sv))
|
||||
return;
|
||||
|
||||
// 2. Let hyperlinkSuffix be null.
|
||||
Optional<String> hyperlink_suffix {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue