Options.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/ByteString.h>
  8. #include <AK/Optional.h>
  9. #include <AK/String.h>
  10. #include <AK/Vector.h>
  11. #include <LibURL/URL.h>
  12. #include <LibWebView/ProcessType.h>
  13. namespace WebView {
  14. enum class NewWindow {
  15. No,
  16. Yes,
  17. };
  18. enum class ForceNewProcess {
  19. No,
  20. Yes,
  21. };
  22. enum class AllowPopups {
  23. No,
  24. Yes,
  25. };
  26. enum class DisableScripting {
  27. No,
  28. Yes,
  29. };
  30. enum class DisableSQLDatabase {
  31. No,
  32. Yes,
  33. };
  34. struct ChromeOptions {
  35. Vector<URL::URL> urls;
  36. Vector<ByteString> raw_urls;
  37. URL::URL new_tab_page_url;
  38. Vector<ByteString> certificates {};
  39. NewWindow new_window { NewWindow::No };
  40. ForceNewProcess force_new_process { ForceNewProcess::No };
  41. AllowPopups allow_popups { AllowPopups::No };
  42. DisableScripting disable_scripting { DisableScripting::No };
  43. DisableSQLDatabase disable_sql_database { DisableSQLDatabase::No };
  44. Optional<ProcessType> debug_helper_process {};
  45. Optional<ProcessType> profile_helper_process {};
  46. Optional<ByteString> webdriver_content_ipc_path {};
  47. };
  48. enum class IsLayoutTestMode {
  49. No,
  50. Yes,
  51. };
  52. enum class UseLagomNetworking {
  53. No,
  54. Yes,
  55. };
  56. enum class LogAllJSExceptions {
  57. No,
  58. Yes,
  59. };
  60. enum class EnableIDLTracing {
  61. No,
  62. Yes,
  63. };
  64. enum class EnableHTTPCache {
  65. No,
  66. Yes,
  67. };
  68. enum class ExposeInternalsObject {
  69. No,
  70. Yes,
  71. };
  72. enum class ForceCPUPainting {
  73. No,
  74. Yes,
  75. };
  76. enum class ForceFontconfig {
  77. No,
  78. Yes,
  79. };
  80. struct WebContentOptions {
  81. String command_line;
  82. String executable_path;
  83. Optional<ByteString> config_path {};
  84. Optional<StringView> user_agent_preset {};
  85. IsLayoutTestMode is_layout_test_mode { IsLayoutTestMode::No };
  86. UseLagomNetworking use_lagom_networking { UseLagomNetworking::Yes };
  87. LogAllJSExceptions log_all_js_exceptions { LogAllJSExceptions::No };
  88. EnableIDLTracing enable_idl_tracing { EnableIDLTracing::No };
  89. EnableHTTPCache enable_http_cache { EnableHTTPCache::No };
  90. ExposeInternalsObject expose_internals_object { ExposeInternalsObject::No };
  91. ForceCPUPainting force_cpu_painting { ForceCPUPainting::No };
  92. ForceFontconfig force_fontconfig { ForceFontconfig::No };
  93. };
  94. }