1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:37:34 +00:00

LibWeb: Implement Window.prompt()

This commit is contained in:
Linus Groh 2021-02-20 12:05:18 +01:00 committed by Andreas Kling
parent f10967e364
commit 5e07c27e25
14 changed files with 74 additions and 2 deletions

View file

@ -71,6 +71,13 @@ bool Window::confirm(const String& message)
return false;
}
String Window::prompt(const String& message, const String& default_)
{
if (auto* page = m_document.page())
return page->client().page_did_request_prompt(message, default_);
return {};
}
i32 Window::set_interval(JS::Function& callback, i32 interval)
{
auto timer = Timer::create_interval(*this, interval, callback);