Options.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. struct WebContentOptions {
  68. String command_line;
  69. String executable_path;
  70. Optional<ByteString> config_path {};
  71. IsLayoutTestMode is_layout_test_mode { IsLayoutTestMode::No };
  72. UseLagomNetworking use_lagom_networking { UseLagomNetworking::Yes };
  73. LogAllJSExceptions log_all_js_exceptions { LogAllJSExceptions::No };
  74. EnableIDLTracing enable_idl_tracing { EnableIDLTracing::No };
  75. EnableHTTPCache enable_http_cache { EnableHTTPCache::No };
  76. ExposeInternalsObject expose_internals_object { ExposeInternalsObject::No };
  77. };
  78. }