Avi Drissman | 4d56a5d | 2022-09-07 17:54:53 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors |
[email protected] | 8a59280 | 2014-07-02 07:31:33 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "android_webview/common/aw_switches.h" |
| 6 | |
| 7 | namespace switches { |
boliu | 1463e1e | 2015-07-23 00:18:04 | [diff] [blame] | 8 | |
Hazem Ashmawy | d8e4e9d42 | 2019-03-25 22:40:28 | [diff] [blame] | 9 | const char kWebViewLogJsConsoleMessages[] = "webview-log-js-console-messages"; |
| 10 | |
simonb | 201d2ae | 2015-09-10 17:34:30 | [diff] [blame] | 11 | const char kWebViewSandboxedRenderer[] = "webview-sandboxed-renderer"; |
boliu | 1463e1e | 2015-07-23 00:18:04 | [diff] [blame] | 12 | |
Nate Fischer | 9f245f5a | 2017-11-07 21:34:30 | [diff] [blame] | 13 | // used to disable safebrowsing functionality in webview |
Nate Fischer | a8f6fbe | 2020-08-10 19:34:33 | [diff] [blame] | 14 | const char kWebViewDisableSafebrowsingSupport[] = |
Nate Fischer | 9f245f5a | 2017-11-07 21:34:30 | [diff] [blame] | 15 | "webview-disable-safebrowsing-support"; |
| 16 | |
Nate Fischer | a8f6fbe | 2020-08-10 19:34:33 | [diff] [blame] | 17 | // Enables SafeBrowsing and causes WebView to treat all resources as malicious. |
| 18 | // Use care: this will block all resources from loading. |
| 19 | const char kWebViewSafebrowsingBlockAllResources[] = |
| 20 | "webview-safebrowsing-block-all-resources"; |
| 21 | |
| 22 | // Highlight the contents (including web contents) of all WebViews with a yellow |
| 23 | // tint. This is useful for identifying WebViews in an Android application. |
| 24 | const char kHighlightAllWebViews[] = "highlight-all-webviews"; |
| 25 | |
Thomas | 431af99 | 2024-05-16 15:05:19 | [diff] [blame] | 26 | // Enable net logging from WebView. This captures network activity for debugging |
| 27 | // purposes, and stores the files in DevUi. |
| 28 | const char kNetLog[] = "net-log"; |
| 29 | |
Nate Fischer | a8f6fbe | 2020-08-10 19:34:33 | [diff] [blame] | 30 | // WebView will log additional debugging information to logcat, such as |
| 31 | // variations and commandline state. |
| 32 | const char kWebViewVerboseLogging[] = "webview-verbose-logging"; |
| 33 | |
| 34 | // The length of time in seconds that an app's copy of the variations seed |
| 35 | // should be considered fresh. If an app's seed is older than this, a new seed |
| 36 | // will be requested from WebView's IVariationsSeedServer. |
| 37 | const char kFinchSeedExpirationAge[] = "finch-seed-expiration-age"; |
| 38 | |
| 39 | // Forces WebView's service to always schedule a new variations seed download |
| 40 | // job, even if one is already pending. |
| 41 | const char kFinchSeedIgnorePendingDownload[] = |
| 42 | "finch-seed-ignore-pending-download"; |
| 43 | |
Nate Fischer | 32b9d3f | 2021-07-07 18:59:45 | [diff] [blame] | 44 | // Forces WebView's service to always schedule a new variations seed download |
| 45 | // job, even if the device is not charging. Note this switch may be necessary |
| 46 | // for testing on Android emulators as these are not always considered to be |
| 47 | // charging. |
| 48 | const char kFinchSeedNoChargingRequirement[] = |
| 49 | "finch-seed-no-charging-requirement"; |
| 50 | |
Nate Fischer | a8f6fbe | 2020-08-10 19:34:33 | [diff] [blame] | 51 | // The minimum amount of time in seconds that WebView's service will wait |
| 52 | // between two variations seed downloads from the variations server. |
| 53 | const char kFinchSeedMinDownloadPeriod[] = "finch-seed-min-download-period"; |
| 54 | |
| 55 | // The minimum amount of time in seconds that the embedded WebView |
| 56 | // implementation will wait between two requests to WebView's service for a new |
| 57 | // variations seed. |
| 58 | const char kFinchSeedMinUpdatePeriod[] = "finch-seed-min-update-period"; |
| 59 | |
Lily Chen | 8ea0f4f | 2020-12-07 22:13:26 | [diff] [blame] | 60 | // Enables modern SameSite cookie behavior (as opposed to legacy behavior). This |
| 61 | // is used for WebView versions prior to when the modern behavior will be |
| 62 | // enabled by default. This enables the same-site-by-default-cookies, |
| 63 | // cookies-without-SameSite-must-be-secure, and schemeful-same-site features. |
| 64 | const char kWebViewEnableModernCookieSameSite[] = |
| 65 | "webview-enable-modern-cookie-same-site"; |
| 66 | |
Michael Bai | fee012d | 2021-08-11 17:13:24 | [diff] [blame] | 67 | // Enables use selective image inversion to automatically darken page, it will |
| 68 | // be used when WebView is in dark mode, but website doesn't provide dark style. |
| 69 | const char kWebViewSelectiveImageInversionDarkening[] = |
Nate Fischer | 422b168 | 2021-09-15 17:22:59 | [diff] [blame] | 70 | "webview-selective-image-inversion-darkening"; |
Michael Bai | fee012d | 2021-08-11 17:13:24 | [diff] [blame] | 71 | |
Rupert Ben Wiser | 85a35a45 | 2024-01-24 16:55:50 | [diff] [blame] | 72 | // Enables FencedFrames. This also enables PrivacySandboxAdsAPIsOverride. |
Kevin McNee | 348df78 | 2023-01-19 19:58:13 | [diff] [blame] | 73 | const char kWebViewFencedFrames[] = "webview-fenced-frames"; |
Ian Vollick | 6d6259f | 2022-05-11 01:59:21 | [diff] [blame] | 74 | |
Rupert Ben Wiser | 70f8cda | 2024-01-11 19:18:00 | [diff] [blame] | 75 | // Enables downloading TpcdMetadataComponentInstallerPolicy by the component |
| 76 | // updater downloading service in nonembedded WebView. |
| 77 | const char kWebViewTpcdMetadaComponent[] = "webview-tpcd-metadata-component"; |
| 78 | |
Rupert Ben Wiser | 0487551a | 2024-02-08 14:56:20 | [diff] [blame] | 79 | // Enables downloading FirstPartySetsComponentInstallerPolicy by the component |
| 80 | // updater downloading service in nonembedded WebView. |
| 81 | const char kWebViewFpsComponent[] = "webview-fps-component"; |
| 82 | |
Alex Kallam | 23d1f3f | 2025-05-08 01:18:50 | [diff] [blame] | 83 | // Enables downloading MaskedDomainListComponentInstallerPolicy by the component |
| 84 | // updater downloading service in nonembedded WebView. |
| 85 | const char kWebViewMaskedDomainListComponent[] = |
| 86 | "webview-masked-domain-list-component"; |
| 87 | |
Rupert Ben Wiser | 64bd01c | 2024-02-15 17:39:52 | [diff] [blame] | 88 | // Force disables 3rd party cookie for all apps. |
| 89 | const char kWebViewForceDisable3pcs[] = "webview-force-disable-3pcs"; |
| 90 | |
Adam Walls | ca6da2c2 | 2024-03-18 21:47:08 | [diff] [blame] | 91 | // Enables crashes during WebView startup in the Java layer |
| 92 | const char kWebViewForceCrashJava[] = "webview-force-crash-java"; |
| 93 | |
| 94 | // Enables crashes during WebView startup in the Native layer |
| 95 | const char kWebViewForceCrashNative[] = "webview-force-crash-native"; |
| 96 | |
Alex Mitra | bb49e80 | 2024-05-16 21:50:11 | [diff] [blame] | 97 | // Use WebView's context for resource lookups instead of the embedding app's. |
| 98 | const char kWebViewUseSeparateResourceContext[] = |
| 99 | "webview-use-separate-resource-context"; |
| 100 | |
Ashley Newson | ac96c5f4 | 2024-06-26 20:03:33 | [diff] [blame] | 101 | // Override and enable features useful for BSA library testing/debugging. |
| 102 | const char kDebugBsa[] = "debug-bsa"; |
Ashley Newson | e903306 | 2024-05-28 16:42:09 | [diff] [blame] | 103 | |
Chidera Olibie | 40f4d45bf | 2025-03-24 13:30:27 | [diff] [blame] | 104 | // Enables using startup tasks logic for webview chromium initialization which |
| 105 | // - runs the startup tasks asynchronously if startup is triggered from a |
| 106 | // background thread. Otherwise runs startup synchronously. |
| 107 | // - caches any chromium startup exception and rethrows it if startup is retried |
| 108 | // without a restart. |
| 109 | const char kWebViewUseStartupTasksLogic[] = "webview-use-startup-tasks-logic"; |
| 110 | |
Chidera Olibie | 20b3c2f4 | 2025-07-03 10:08:17 | [diff] [blame] | 111 | // Enables phase 2 of using startup tasks logic for webview chromium |
| 112 | // initialization which also starts browser processes asynchronously, when |
| 113 | // starting webview asynchronously. |
| 114 | const char kWebViewUseStartupTasksLogicP2[] = |
| 115 | "webview-use-startup-tasks-logic-p2"; |
| 116 | |
Chidera Olibie | a9f2e505 | 2025-07-09 18:53:47 | [diff] [blame] | 117 | // Enables running native startup tasks asynchronously if WebView startup is |
| 118 | // asynchronous. |
| 119 | const char kWebViewStartupTasksYieldToNative[] = |
| 120 | "webview-startup-tasks-yield-to-native"; |
[email protected] | 8a59280 | 2014-07-02 07:31:33 | [diff] [blame] | 121 | } // namespace switches |