Options.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 DisableSQLDatabase {
  27. No,
  28. Yes,
  29. };
  30. struct ChromeOptions {
  31. Vector<URL::URL> urls;
  32. Vector<ByteString> raw_urls;
  33. URL::URL new_tab_page_url;
  34. Vector<ByteString> certificates {};
  35. NewWindow new_window { NewWindow::No };
  36. ForceNewProcess force_new_process { ForceNewProcess::No };
  37. AllowPopups allow_popups { AllowPopups::No };
  38. DisableSQLDatabase disable_sql_database { DisableSQLDatabase::No };
  39. Optional<ProcessType> debug_helper_process {};
  40. Optional<ProcessType> profile_helper_process {};
  41. Optional<ByteString> webdriver_content_ipc_path {};
  42. };
  43. enum class IsLayoutTestMode {
  44. No,
  45. Yes,
  46. };
  47. enum class UseLagomNetworking {
  48. No,
  49. Yes,
  50. };
  51. enum class LogAllJSExceptions {
  52. No,
  53. Yes,
  54. };
  55. enum class EnableIDLTracing {
  56. No,
  57. Yes,
  58. };
  59. enum class EnableHTTPCache {
  60. No,
  61. Yes,
  62. };
  63. enum class ExposeInternalsObject {
  64. No,
  65. Yes,
  66. };
  67. enum class ForceCPUPainting {
  68. No,
  69. Yes,
  70. };
  71. struct WebContentOptions {
  72. String command_line;
  73. String executable_path;
  74. Optional<ByteString> config_path {};
  75. IsLayoutTestMode is_layout_test_mode { IsLayoutTestMode::No };
  76. UseLagomNetworking use_lagom_networking { UseLagomNetworking::Yes };
  77. LogAllJSExceptions log_all_js_exceptions { LogAllJSExceptions::No };
  78. EnableIDLTracing enable_idl_tracing { EnableIDLTracing::No };
  79. EnableHTTPCache enable_http_cache { EnableHTTPCache::No };
  80. ExposeInternalsObject expose_internals_object { ExposeInternalsObject::No };
  81. ForceCPUPainting force_cpu_painting { ForceCPUPainting::No };
  82. };
  83. }