mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
WebDriver script authors may now provide either: * A user prompt handler configuration to be used for all prompt types. * A set of per-prompt-type user prompt handlers. This also paves the way for interaction with the beforeunload prompt, though we do not yet support that feature in LibWeb. See: https://github.com/w3c/webdriver/commit/43903d0
48 lines
989 B
C++
48 lines
989 B
C++
/*
|
|
* Copyright (c) 2022-2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Forward.h>
|
|
#include <AK/StringView.h>
|
|
#include <LibWeb/WebDriver/Response.h>
|
|
|
|
namespace Web::WebDriver {
|
|
|
|
// https://w3c.github.io/webdriver/#dfn-page-load-strategy
|
|
enum class PageLoadStrategy {
|
|
None,
|
|
Eager,
|
|
Normal,
|
|
};
|
|
|
|
constexpr PageLoadStrategy page_load_strategy_from_string(StringView strategy)
|
|
{
|
|
if (strategy == "none"sv)
|
|
return PageLoadStrategy::None;
|
|
if (strategy == "eager"sv)
|
|
return PageLoadStrategy::Eager;
|
|
if (strategy == "normal"sv)
|
|
return PageLoadStrategy::Normal;
|
|
VERIFY_NOT_REACHED();
|
|
}
|
|
|
|
enum class InterfaceMode {
|
|
Graphical,
|
|
Headless,
|
|
};
|
|
void set_default_interface_mode(InterfaceMode);
|
|
|
|
struct LadybirdOptions {
|
|
explicit LadybirdOptions(JsonObject const& capabilities);
|
|
|
|
bool headless { false };
|
|
};
|
|
|
|
Response process_capabilities(JsonValue const& parameters);
|
|
|
|
}
|