options_switches.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. // Copyright (c) 2013 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_COMMON_OPTIONS_SWITCHES_H_
  5. #define ELECTRON_SHELL_COMMON_OPTIONS_SWITCHES_H_
  6. #include <string_view>
  7. #include "base/strings/cstring_view.h"
  8. namespace electron {
  9. namespace options {
  10. inline constexpr std::string_view kTitle = "title";
  11. inline constexpr std::string_view kIcon = "icon";
  12. inline constexpr std::string_view kFrame = "frame";
  13. inline constexpr std::string_view kShow = "show";
  14. inline constexpr std::string_view kCenter = "center";
  15. inline constexpr std::string_view kX = "x";
  16. inline constexpr std::string_view kY = "y";
  17. inline constexpr std::string_view kWidth = "width";
  18. inline constexpr std::string_view kHeight = "height";
  19. inline constexpr std::string_view kMinWidth = "minWidth";
  20. inline constexpr std::string_view kMinHeight = "minHeight";
  21. inline constexpr std::string_view kMaxWidth = "maxWidth";
  22. inline constexpr std::string_view kMaxHeight = "maxHeight";
  23. inline constexpr std::string_view kResizable = "resizable";
  24. inline constexpr std::string_view kMovable = "movable";
  25. inline constexpr std::string_view kMinimizable = "minimizable";
  26. inline constexpr std::string_view kMaximizable = "maximizable";
  27. inline constexpr std::string_view kFullScreenable = "fullscreenable";
  28. inline constexpr std::string_view kClosable = "closable";
  29. // whether to keep the window out of mission control
  30. inline constexpr std::string_view kHiddenInMissionControl =
  31. "hiddenInMissionControl";
  32. inline constexpr std::string_view kFullscreen = "fullscreen";
  33. // Whether the window should show in taskbar.
  34. inline constexpr std::string_view kSkipTaskbar = "skipTaskbar";
  35. // Start with the kiosk mode, see Opera's page for description:
  36. // http://www.opera.com/support/mastering/kiosk/
  37. inline constexpr std::string_view kKiosk = "kiosk";
  38. inline constexpr std::string_view kSimpleFullscreen = "simpleFullscreen";
  39. // Make windows stays on the top of all other windows.
  40. inline constexpr std::string_view kAlwaysOnTop = "alwaysOnTop";
  41. // Enable the NSView to accept first mouse event.
  42. inline constexpr std::string_view kAcceptFirstMouse = "acceptFirstMouse";
  43. // Whether window size should include window frame.
  44. inline constexpr std::string_view kUseContentSize = "useContentSize";
  45. // Whether window zoom should be to page width.
  46. inline constexpr std::string_view kZoomToPageWidth = "zoomToPageWidth";
  47. // The requested title bar style for the window
  48. inline constexpr std::string_view kTitleBarStyle = "titleBarStyle";
  49. // Tabbing identifier for the window if native tabs are enabled on macOS.
  50. inline constexpr std::string_view kTabbingIdentifier = "tabbingIdentifier";
  51. // The menu bar is hidden unless "Alt" is pressed.
  52. inline constexpr std::string_view kAutoHideMenuBar = "autoHideMenuBar";
  53. // Enable window to be resized larger than screen.
  54. inline constexpr std::string_view kEnableLargerThanScreen =
  55. "enableLargerThanScreen";
  56. // Forces to use dark theme on Linux.
  57. inline constexpr std::string_view kDarkTheme = "darkTheme";
  58. // Whether the window should be transparent.
  59. inline constexpr std::string_view kTransparent = "transparent";
  60. // Window type hint.
  61. inline constexpr std::string_view kType = "type";
  62. // Disable auto-hiding cursor.
  63. inline constexpr std::string_view kDisableAutoHideCursor =
  64. "disableAutoHideCursor";
  65. // Default browser window background color.
  66. inline constexpr std::string_view kBackgroundColor = "backgroundColor";
  67. // Whether the window should have a shadow.
  68. inline constexpr std::string_view kHasShadow = "hasShadow";
  69. // Browser window opacity
  70. inline constexpr std::string_view kOpacity = "opacity";
  71. // Whether the window can be activated.
  72. inline constexpr std::string_view kFocusable = "focusable";
  73. // The WebPreferences.
  74. inline constexpr std::string_view kWebPreferences = "webPreferences";
  75. // Add a vibrancy effect to the browser window
  76. inline constexpr std::string_view kVibrancyType = "vibrancy";
  77. // Add a vibrancy effect to the browser window.
  78. inline constexpr std::string_view kBackgroundMaterial = "backgroundMaterial";
  79. // Specify how the material appearance should reflect window activity state on
  80. // macOS.
  81. inline constexpr std::string_view kVisualEffectState = "visualEffectState";
  82. inline constexpr std::string_view kTrafficLightPosition =
  83. "trafficLightPosition";
  84. inline constexpr std::string_view kRoundedCorners = "roundedCorners";
  85. inline constexpr std::string_view ktitleBarOverlay = "titleBarOverlay";
  86. // The color to use as the theme and symbol colors respectively for Window
  87. // Controls Overlay if enabled on Windows.
  88. inline constexpr std::string_view kOverlayButtonColor = "color";
  89. inline constexpr std::string_view kOverlaySymbolColor = "symbolColor";
  90. // The custom height for Window Controls Overlay.
  91. inline constexpr std::string_view kOverlayHeight = "height";
  92. /// WebPreferences.
  93. // The factor of which page should be zoomed.
  94. inline constexpr std::string_view kZoomFactor = "zoomFactor";
  95. // Script that will be loaded by guest WebContents before other scripts.
  96. inline constexpr std::string_view kPreloadScript = "preload";
  97. // Enable the node integration.
  98. inline constexpr std::string_view kNodeIntegration = "nodeIntegration";
  99. // Enable context isolation of Electron APIs and preload script
  100. inline constexpr std::string_view kContextIsolation = "contextIsolation";
  101. // Web runtime features.
  102. inline constexpr std::string_view kExperimentalFeatures =
  103. "experimentalFeatures";
  104. // Enable the rubber banding effect.
  105. inline constexpr std::string_view kScrollBounce = "scrollBounce";
  106. // Enable blink features.
  107. inline constexpr std::string_view kEnableBlinkFeatures = "enableBlinkFeatures";
  108. // Disable blink features.
  109. inline constexpr std::string_view kDisableBlinkFeatures =
  110. "disableBlinkFeatures";
  111. // Enable the node integration in WebWorker.
  112. inline constexpr std::string_view kNodeIntegrationInWorker =
  113. "nodeIntegrationInWorker";
  114. // Enable the web view tag.
  115. inline constexpr std::string_view kWebviewTag = "webviewTag";
  116. inline constexpr std::string_view kCustomArgs = "additionalArguments";
  117. inline constexpr std::string_view kPlugins = "plugins";
  118. inline constexpr std::string_view kSandbox = "sandbox";
  119. inline constexpr std::string_view kWebSecurity = "webSecurity";
  120. inline constexpr std::string_view kAllowRunningInsecureContent =
  121. "allowRunningInsecureContent";
  122. inline constexpr std::string_view kOffscreen = "offscreen";
  123. inline constexpr std::string_view kUseSharedTexture = "useSharedTexture";
  124. inline constexpr std::string_view kNodeIntegrationInSubFrames =
  125. "nodeIntegrationInSubFrames";
  126. // Disable window resizing when HTML Fullscreen API is activated.
  127. inline constexpr std::string_view kDisableHtmlFullscreenWindowResize =
  128. "disableHtmlFullscreenWindowResize";
  129. // Enables JavaScript support.
  130. inline constexpr std::string_view kJavaScript = "javascript";
  131. // Enables image support.
  132. inline constexpr std::string_view kImages = "images";
  133. // Make TextArea elements resizable.
  134. inline constexpr std::string_view kTextAreasAreResizable =
  135. "textAreasAreResizable";
  136. // Enables WebGL support.
  137. inline constexpr std::string_view kWebGL = "webgl";
  138. // Whether dragging and dropping a file or link onto the page causes a
  139. // navigation.
  140. inline constexpr std::string_view kNavigateOnDragDrop = "navigateOnDragDrop";
  141. inline constexpr std::string_view kEnablePreferredSizeMode =
  142. "enablePreferredSizeMode";
  143. inline constexpr std::string_view kHiddenPage = "hiddenPage";
  144. inline constexpr std::string_view kSpellcheck = "spellcheck";
  145. // Enables the permission managed support for
  146. // document.execCommand("paste").
  147. inline constexpr std::string_view kEnableDeprecatedPaste =
  148. "enableDeprecatedPaste";
  149. // Whether the -electron-corner-smoothing CSS rule is enabled.
  150. inline constexpr std::string_view kEnableCornerSmoothingCSS =
  151. "enableCornerSmoothingCSS";
  152. } // namespace options
  153. // Following are actually command line switches, should be moved to other files.
  154. namespace switches {
  155. // Implementation detail: base::cstring_view used for switches because
  156. // base::CommandLine::CopySwitchesFrom() still needs C-style strings.
  157. // These constants can migrate to std::string_view if that function does.
  158. // Enable chromium sandbox.
  159. inline constexpr base::cstring_view kEnableSandbox = "enable-sandbox";
  160. // Disable HTTP cache.
  161. inline constexpr base::cstring_view kDisableHttpCache = "disable-http-cache";
  162. // The list of standard schemes.
  163. inline constexpr base::cstring_view kStandardSchemes = "standard-schemes";
  164. // Register schemes to handle service worker.
  165. inline constexpr base::cstring_view kServiceWorkerSchemes =
  166. "service-worker-schemes";
  167. // Register schemes as secure.
  168. inline constexpr base::cstring_view kSecureSchemes = "secure-schemes";
  169. // Register schemes as bypassing CSP.
  170. inline constexpr base::cstring_view kBypassCSPSchemes = "bypasscsp-schemes";
  171. // Register schemes as support fetch API.
  172. inline constexpr base::cstring_view kFetchSchemes = "fetch-schemes";
  173. // Register schemes as CORS enabled.
  174. inline constexpr base::cstring_view kCORSSchemes = "cors-schemes";
  175. // Register schemes as streaming responses.
  176. inline constexpr base::cstring_view kStreamingSchemes = "streaming-schemes";
  177. // Register schemes as supporting V8 code cache.
  178. inline constexpr base::cstring_view kCodeCacheSchemes = "code-cache-schemes";
  179. // The browser process app model ID
  180. inline constexpr base::cstring_view kAppUserModelId = "app-user-model-id";
  181. // The application path
  182. inline constexpr base::cstring_view kAppPath = "app-path";
  183. // The command line switch versions of the options.
  184. inline constexpr base::cstring_view kScrollBounce = "scroll-bounce";
  185. // Command switch passed to renderer process to control nodeIntegration.
  186. inline constexpr base::cstring_view kNodeIntegrationInWorker =
  187. "node-integration-in-worker";
  188. // Widevine options
  189. // Path to Widevine CDM binaries.
  190. inline constexpr base::cstring_view kWidevineCdmPath = "widevine-cdm-path";
  191. // Widevine CDM version.
  192. inline constexpr base::cstring_view kWidevineCdmVersion =
  193. "widevine-cdm-version";
  194. // Forces the maximum disk space to be used by the disk cache, in bytes.
  195. inline constexpr base::cstring_view kDiskCacheSize = "disk-cache-size";
  196. // Ignore the limit of 6 connections per host.
  197. inline constexpr base::cstring_view kIgnoreConnectionsLimit =
  198. "ignore-connections-limit";
  199. // Whitelist containing servers for which Integrated Authentication is enabled.
  200. inline constexpr base::cstring_view kAuthServerWhitelist =
  201. "auth-server-whitelist";
  202. // Whitelist containing servers for which Kerberos delegation is allowed.
  203. inline constexpr base::cstring_view kAuthNegotiateDelegateWhitelist =
  204. "auth-negotiate-delegate-whitelist";
  205. // If set, include the port in generated Kerberos SPNs.
  206. inline constexpr base::cstring_view kEnableAuthNegotiatePort =
  207. "enable-auth-negotiate-port";
  208. // If set, NTLM v2 is disabled for POSIX platforms.
  209. inline constexpr base::cstring_view kDisableNTLMv2 = "disable-ntlm-v2";
  210. // Indicates that preloads for service workers are registered.
  211. inline constexpr base::cstring_view kServiceWorkerPreload =
  212. "service-worker-preload";
  213. } // namespace switches
  214. } // namespace electron
  215. #endif // ELECTRON_SHELL_COMMON_OPTIONS_SWITCHES_H_