Ladybird: Basic support for window.alert() and window.confirm()

This commit is contained in:
Andreas Kling 2022-07-17 14:48:28 +02:00 committed by Andrew Kaster
parent aa5f886128
commit f2b126f4d7
Notes: sideshowbarker 2024-07-17 02:47:56 +09:00

View file

@ -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