mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
LibWeb: Implement Window.prompt()
This commit is contained in:
parent
f10967e364
commit
5e07c27e25
Notes:
sideshowbarker
2024-07-18 22:07:15 +09:00
Author: https://github.com/linusg
Commit: 5e07c27e25
Pull-request: https://github.com/SerenityOS/serenity/pull/5423
Reviewed-by: https://github.com/awesomekling
14 changed files with 74 additions and 2 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "WebContentClient.h"
|
||||
#include <AK/String.h>
|
||||
#include <AK/URLParser.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
|
@ -293,6 +294,14 @@ bool OutOfProcessWebView::notify_server_did_request_confirm(Badge<WebContentClie
|
|||
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
|
||||
}
|
||||
|
||||
String OutOfProcessWebView::notify_server_did_request_prompt(Badge<WebContentClient>, const String& message, const String& default_)
|
||||
{
|
||||
String response { default_ };
|
||||
if (GUI::InputBox::show(window(), response, message, "Prompt") == GUI::InputBox::ExecOK)
|
||||
return response;
|
||||
return {};
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::did_scroll()
|
||||
{
|
||||
client().post_message(Messages::WebContentServer::SetViewportRect(visible_content_rect()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue