diff options
author | Andreas Kling <kling@serenityos.org> | 2022-07-17 14:48:28 +0200 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2022-12-25 07:58:58 -0700 |
commit | f2b126f4d7041a15fb82aa6e8341a5f903032202 (patch) | |
tree | 8b9d8cdc58b6c1f51407778d1e46847692bb2676 /Ladybird | |
parent | aa5f88612808e68b5ec239b9a374493a5b8d9459 (diff) | |
download | serenity-f2b126f4d7041a15fb82aa6e8341a5f903032202.zip |
Ladybird: Basic support for window.alert() and window.confirm()
Diffstat (limited to 'Ladybird')
-rw-r--r-- | Ladybird/WebView.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Ladybird/WebView.cpp b/Ladybird/WebView.cpp index 107b7c5fdf..e8f009d1d0 100644 --- a/Ladybird/WebView.cpp +++ b/Ladybird/WebView.cpp @@ -289,13 +289,17 @@ public: { } - virtual void page_did_request_alert(String const&) override + virtual void page_did_request_alert(String const& message) override { + QMessageBox::warning(&m_view, "Ladybird", qstring_from_akstring(message)); } - virtual bool page_did_request_confirm(String const&) override + virtual bool page_did_request_confirm(String const& message) override { - return false; + auto result = QMessageBox::question(&m_view, "Ladybird", qstring_from_akstring(message), + QMessageBox::StandardButton::Ok | QMessageBox::StandardButton::Cancel); + + return result == QMessageBox::StandardButton::Ok; } virtual String page_did_request_prompt(String const&, String const&) override |