2023-08-01 17:39:19 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-07-30 15:01:05 -03:00
|
|
|
#include <AK/ByteString.h>
|
|
|
|
|
#include <AK/Optional.h>
|
2024-01-16 14:55:40 -03:00
|
|
|
#include <AK/String.h>
|
2024-07-30 15:01:05 -03:00
|
|
|
#include <AK/Vector.h>
|
|
|
|
|
#include <LibURL/URL.h>
|
2024-08-01 08:03:03 -03:00
|
|
|
#include <LibWebView/ProcessType.h>
|
2024-01-16 14:55:40 -03:00
|
|
|
|
2024-07-30 15:01:05 -03:00
|
|
|
namespace WebView {
|
|
|
|
|
|
2025-06-06 16:42:12 -03:00
|
|
|
enum class HeadlessMode {
|
|
|
|
|
Screenshot,
|
|
|
|
|
LayoutTree,
|
|
|
|
|
Text,
|
2025-11-13 13:29:19 -03:00
|
|
|
Manual,
|
2025-06-06 16:42:12 -03:00
|
|
|
Test,
|
|
|
|
|
};
|
|
|
|
|
|
2024-07-30 15:01:05 -03:00
|
|
|
enum class NewWindow {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum class ForceNewProcess {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum class AllowPopups {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-04 03:13:40 -03:00
|
|
|
enum class DisableScripting {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-07-30 15:01:05 -03:00
|
|
|
enum class DisableSQLDatabase {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-22 19:12:36 -03:00
|
|
|
enum class EnableAutoplay {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-11-01 19:53:43 -03:00
|
|
|
struct SystemDNS { };
|
|
|
|
|
struct DNSOverTLS {
|
|
|
|
|
ByteString server_address;
|
|
|
|
|
u16 port;
|
2025-05-13 07:34:55 -03:00
|
|
|
bool validate_dnssec_locally;
|
2024-11-01 19:53:43 -03:00
|
|
|
};
|
|
|
|
|
struct DNSOverUDP {
|
|
|
|
|
ByteString server_address;
|
|
|
|
|
u16 port;
|
2025-05-13 07:34:55 -03:00
|
|
|
bool validate_dnssec_locally;
|
2024-11-01 19:53:43 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using DNSSettings = Variant<SystemDNS, DNSOverTLS, DNSOverUDP>;
|
|
|
|
|
|
2025-03-15 11:09:45 -03:00
|
|
|
constexpr inline u16 default_devtools_port = 6000;
|
|
|
|
|
|
2026-05-21 11:36:25 -03:00
|
|
|
enum class EnableContentBlocker {
|
2025-10-17 05:38:31 -03:00
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-16 10:06:48 -03:00
|
|
|
enum class DisableSandbox {
|
2026-05-20 12:19:06 -03:00
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2025-03-15 17:56:52 -03:00
|
|
|
struct BrowserOptions {
|
2024-07-30 15:01:05 -03:00
|
|
|
Vector<URL::URL> urls;
|
|
|
|
|
Vector<ByteString> raw_urls;
|
2025-06-06 16:42:12 -03:00
|
|
|
Optional<HeadlessMode> headless_mode;
|
2026-05-12 19:57:55 -03:00
|
|
|
Optional<ByteString> screenshot_path {};
|
2026-04-09 06:59:55 -03:00
|
|
|
u32 screenshot_delay { 1 };
|
2025-06-06 16:42:12 -03:00
|
|
|
int window_width { 800 };
|
|
|
|
|
int window_height { 600 };
|
2024-07-30 15:01:05 -03:00
|
|
|
NewWindow new_window { NewWindow::No };
|
|
|
|
|
ForceNewProcess force_new_process { ForceNewProcess::No };
|
|
|
|
|
AllowPopups allow_popups { AllowPopups::No };
|
2024-09-04 03:13:40 -03:00
|
|
|
DisableScripting disable_scripting { DisableScripting::No };
|
2024-07-30 15:01:05 -03:00
|
|
|
DisableSQLDatabase disable_sql_database { DisableSQLDatabase::No };
|
2026-04-09 05:41:02 -03:00
|
|
|
Vector<ProcessType> debug_helper_processes {};
|
2024-08-01 08:13:09 -03:00
|
|
|
Optional<ProcessType> profile_helper_process {};
|
2026-03-22 15:59:08 -03:00
|
|
|
Optional<ByteString> webdriver_endpoint {};
|
2025-04-07 22:56:35 -03:00
|
|
|
Optional<DNSSettings> dns_settings {};
|
2025-07-02 13:42:53 -03:00
|
|
|
Optional<u16> devtools_port;
|
2026-05-21 11:36:25 -03:00
|
|
|
EnableContentBlocker enable_content_blocker { EnableContentBlocker::Yes };
|
2026-06-16 10:06:48 -03:00
|
|
|
DisableSandbox disable_sandbox { DisableSandbox::No };
|
2026-05-21 12:46:17 -03:00
|
|
|
Vector<ByteString> content_blocker_list_paths {};
|
2024-07-30 15:01:05 -03:00
|
|
|
};
|
2023-08-02 14:52:59 -03:00
|
|
|
|
2025-11-18 12:18:40 -03:00
|
|
|
enum class HTTPDiskCacheMode {
|
|
|
|
|
Disabled,
|
|
|
|
|
Enabled,
|
2026-01-11 13:00:00 -03:00
|
|
|
Partitioned,
|
2025-11-18 12:18:40 -03:00
|
|
|
Testing,
|
2025-10-08 22:17:05 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct RequestServerOptions {
|
|
|
|
|
Vector<ByteString> certificates;
|
2025-11-18 12:18:40 -03:00
|
|
|
HTTPDiskCacheMode http_disk_cache_mode { HTTPDiskCacheMode::Disabled };
|
2026-01-18 06:13:24 -03:00
|
|
|
Optional<ByteString> resource_substitution_map_path;
|
2025-10-08 22:17:05 -03:00
|
|
|
};
|
|
|
|
|
|
2026-01-08 12:09:53 -03:00
|
|
|
enum class IsTestMode {
|
2023-12-01 14:18:40 -03:00
|
|
|
No,
|
2024-07-30 15:01:05 -03:00
|
|
|
Yes,
|
2023-12-01 14:18:40 -03:00
|
|
|
};
|
|
|
|
|
|
2024-04-16 03:02:41 -03:00
|
|
|
enum class LogAllJSExceptions {
|
|
|
|
|
No,
|
2024-07-30 15:01:05 -03:00
|
|
|
Yes,
|
2024-04-16 03:02:41 -03:00
|
|
|
};
|
|
|
|
|
|
2024-04-16 09:39:57 -03:00
|
|
|
enum class EnableIDLTracing {
|
|
|
|
|
No,
|
2024-07-30 15:01:05 -03:00
|
|
|
Yes,
|
2024-04-16 09:39:57 -03:00
|
|
|
};
|
|
|
|
|
|
2025-12-01 17:11:27 -03:00
|
|
|
enum class EnableMemoryHTTPCache {
|
2024-06-22 13:53:11 -03:00
|
|
|
No,
|
2024-07-30 15:01:05 -03:00
|
|
|
Yes,
|
2024-06-22 13:53:11 -03:00
|
|
|
};
|
|
|
|
|
|
2025-03-11 20:25:34 -03:00
|
|
|
enum class DisableSiteIsolation {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-17 15:47:21 -03:00
|
|
|
enum class ExposeExperimentalInterfaces {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-04-20 17:46:38 -03:00
|
|
|
enum class ExposeInternalsObject {
|
|
|
|
|
No,
|
2024-07-30 15:01:05 -03:00
|
|
|
Yes,
|
2024-04-20 17:46:38 -03:00
|
|
|
};
|
|
|
|
|
|
2024-08-01 14:49:24 -03:00
|
|
|
enum class ForceCPUPainting {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-19 15:35:49 -03:00
|
|
|
enum class ForceFontconfig {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-31 12:06:01 -03:00
|
|
|
enum class CollectGarbageOnEveryAllocation {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-16 08:23:10 -03:00
|
|
|
enum class PaintViewportScrollbars {
|
|
|
|
|
Yes,
|
|
|
|
|
No,
|
|
|
|
|
};
|
|
|
|
|
|
LibWeb: Add compositor scroll state snapshots
Record the scroll geometry that CompositorThread can safely reason about
while the main thread is painting. The snapshot contains stable scroll
node IDs, parent links, scroll bounds, sticky inputs, and wheel blocker
regions in display-list coordinate space.
Add AsyncScrollingState and AsyncScrollTree under LibWeb/Compositor. The
state is the immutable main-thread snapshot; the tree is the mutable
compositor-side copy that can replay scroll deltas and sticky offsets
without touching DOM, layout, or paintables.
Expose the state through internals and add text tests for tree shape,
parent links, sticky areas, blocker hit testing, nested scrollers, and
admission decisions. Keep the directory skipped unless the feature is
enabled with --enable-async-scrolling.
2026-05-11 16:27:11 -03:00
|
|
|
enum class EnableAsyncScrolling {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-01 17:03:35 -03:00
|
|
|
enum class FileSchemeUrlsHaveTupleOrigins {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-13 11:06:49 -03:00
|
|
|
enum class ReportSessionHistoryUpdatesInTestMode {
|
|
|
|
|
No,
|
|
|
|
|
Yes,
|
|
|
|
|
};
|
|
|
|
|
|
2023-12-01 14:18:40 -03:00
|
|
|
struct WebContentOptions {
|
2024-07-16 13:52:12 -03:00
|
|
|
Optional<ByteString> config_path {};
|
2024-08-28 11:26:11 -03:00
|
|
|
Optional<StringView> user_agent_preset {};
|
2026-01-08 12:09:53 -03:00
|
|
|
IsTestMode is_test_mode { IsTestMode::No };
|
2024-04-16 03:02:41 -03:00
|
|
|
LogAllJSExceptions log_all_js_exceptions { LogAllJSExceptions::No };
|
2025-03-11 20:25:34 -03:00
|
|
|
DisableSiteIsolation disable_site_isolation { DisableSiteIsolation::No };
|
2024-04-16 09:39:57 -03:00
|
|
|
EnableIDLTracing enable_idl_tracing { EnableIDLTracing::No };
|
2025-12-01 17:11:27 -03:00
|
|
|
EnableMemoryHTTPCache enable_http_memory_cache { EnableMemoryHTTPCache::No };
|
2026-02-17 15:47:21 -03:00
|
|
|
ExposeExperimentalInterfaces expose_experimental_interfaces { ExposeExperimentalInterfaces::No };
|
2024-04-20 17:46:38 -03:00
|
|
|
ExposeInternalsObject expose_internals_object { ExposeInternalsObject::No };
|
2024-08-01 14:49:24 -03:00
|
|
|
ForceCPUPainting force_cpu_painting { ForceCPUPainting::No };
|
2024-08-19 15:35:49 -03:00
|
|
|
ForceFontconfig force_fontconfig { ForceFontconfig::No };
|
2024-09-22 19:12:36 -03:00
|
|
|
EnableAutoplay enable_autoplay { EnableAutoplay::No };
|
2024-10-31 12:06:01 -03:00
|
|
|
CollectGarbageOnEveryAllocation collect_garbage_on_every_allocation { CollectGarbageOnEveryAllocation::No };
|
2024-12-02 22:33:26 -03:00
|
|
|
Optional<u16> echo_server_port {};
|
2024-12-16 08:23:10 -03:00
|
|
|
PaintViewportScrollbars paint_viewport_scrollbars { PaintViewportScrollbars::Yes };
|
2026-05-14 18:29:51 -03:00
|
|
|
EnableAsyncScrolling enable_async_scrolling { EnableAsyncScrolling::Yes };
|
2026-04-01 17:03:35 -03:00
|
|
|
FileSchemeUrlsHaveTupleOrigins file_scheme_urls_have_tuple_origins { FileSchemeUrlsHaveTupleOrigins::No };
|
2026-06-13 11:06:49 -03:00
|
|
|
ReportSessionHistoryUpdatesInTestMode report_session_history_updates_in_test_mode { ReportSessionHistoryUpdatesInTestMode::No };
|
2025-10-15 09:17:37 -03:00
|
|
|
Optional<StringView> default_time_zone {};
|
2026-04-29 14:34:24 -03:00
|
|
|
Optional<u64> style_invalidation_counter_dump_interval {};
|
2023-12-01 14:18:40 -03:00
|
|
|
};
|
|
|
|
|
|
2023-08-02 14:52:59 -03:00
|
|
|
}
|