LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
21.78k stars 966 forks source link

Search on the modern google homepage does not work #2163

Open Pinguin2001 opened 3 days ago

Pinguin2001 commented 3 days ago

Summary

When I go to the Google homepage and enter a query and hit enter, nothing happens.

The modern google homepage requires a fake useragent, such as Chrome on macOS

Operating system

Linux

Using ladybird https://github.com/LadybirdBrowser/ladybird/commit/3e57f472f58344d13347850f4debaf0e9194e6e2

Re-verified on https://github.com/LadybirdBrowser/ladybird/commit/1388b6866e25447335a7f5bd25d3153c710c0670

Steps to reproduce

  1. Type any text in the textarea
  2. Hit enter

Expected behavior

The website detects the query being submitted and redirects to the search results page

Actual behavior

No query is performed, sometimes a new line is created

URL for a reduced test case

https://www.google.com/

HTML/SVG/etc. source for a reduced test case

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- code extracted from google.com -->
    <form action="/search" autocomplete="off" method="GET" role="search">
        <div>
            <textarea></textarea>
        </div>
        <script nonce="">(function () {
                var a = this || self; var c = document.querySelector("form"); if (c) { var d = function (b) { b.key !== "Enter" || b.shiftKey || (b.preventDefault(), c.submit && c.submit()) }; c.addEventListener("keydown", d); a.sbmlhf = d };
            }).call(this);</script>
    </form>
</body>

</html>

Log output and (if possible) backtrace

[julian@asus ladybird]$ ./Meta/ladybird.sh run ladybird http://localhost:5500/
ninja: Entering directory `/home/julian/ladybird/Build/ladybird'
[0/2] Re-checking globbed directories...
ninja: no work to do.
5720.973 WebContent(21382): (js log) "Live reload enabled."
5720.973 RequestServer(21374): WebSocket: Connection error (underlying socket)
5720.973 WebContent(21382): ResourceLoader: Failed load of: "http://localhost:5500/favicon.ico", Error: Load failed (status: 404 Not Found), Duration: 0ms
qt.qpa.wayland.textinput: virtual void QtWaylandClient::QWaylandTextInputv3::zwp_text_input_v3_leave(wl_surface*) Got leave event for surface 0x0 focused surface 0x5f6179f1d7e0
[julian@asus ladybird]$

Screenshots or screen recordings

https://github.com/user-attachments/assets/2a1417bf-a6b8-4b78-8b37-d266164c2127

Build flags or config settings

No response

Contribute a patch?

shlyakpavel commented 1 day ago

It works different with AppKit chrome

https://github.com/user-attachments/assets/0c2d4834-9db3-4664-a539-cc8c30b3650a