blob: d0fbc6f2f3353b47bd357e42caa0505262c48595 [file] [log] [blame]
Avi Drissman4d56a5d2022-09-07 17:54:531// Copyright 2014 The Chromium Authors
[email protected]8a592802014-07-02 07:31:332// 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
7namespace switches {
boliu1463e1e2015-07-23 00:18:048
Hazem Ashmawyd8e4e9d422019-03-25 22:40:289const char kWebViewLogJsConsoleMessages[] = "webview-log-js-console-messages";
10
simonb201d2ae2015-09-10 17:34:3011const char kWebViewSandboxedRenderer[] = "webview-sandboxed-renderer";
boliu1463e1e2015-07-23 00:18:0412
Nate Fischer9f245f5a2017-11-07 21:34:3013// used to disable safebrowsing functionality in webview
Nate Fischera8f6fbe2020-08-10 19:34:3314const char kWebViewDisableSafebrowsingSupport[] =
Nate Fischer9f245f5a2017-11-07 21:34:3015 "webview-disable-safebrowsing-support";
16
Nate Fischera8f6fbe2020-08-10 19:34:3317// Enables SafeBrowsing and causes WebView to treat all resources as malicious.
18// Use care: this will block all resources from loading.
19const 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.
24const char kHighlightAllWebViews[] = "highlight-all-webviews";
25
Thomas431af992024-05-16 15:05:1926// Enable net logging from WebView. This captures network activity for debugging
27// purposes, and stores the files in DevUi.
28const char kNetLog[] = "net-log";
29
Nate Fischera8f6fbe2020-08-10 19:34:3330// WebView will log additional debugging information to logcat, such as
31// variations and commandline state.
32const 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.
37const 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.
41const char kFinchSeedIgnorePendingDownload[] =
42 "finch-seed-ignore-pending-download";
43
Nate Fischer32b9d3f2021-07-07 18:59:4544// 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.
48const char kFinchSeedNoChargingRequirement[] =
49 "finch-seed-no-charging-requirement";
50
Nate Fischera8f6fbe2020-08-10 19:34:3351// The minimum amount of time in seconds that WebView's service will wait
52// between two variations seed downloads from the variations server.
53const 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.
58const char kFinchSeedMinUpdatePeriod[] = "finch-seed-min-update-period";
59
Lily Chen8ea0f4f2020-12-07 22:13:2660// 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.
64const char kWebViewEnableModernCookieSameSite[] =
65 "webview-enable-modern-cookie-same-site";
66
Michael Baifee012d2021-08-11 17:13:2467// 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.
69const char kWebViewSelectiveImageInversionDarkening[] =
Nate Fischer422b1682021-09-15 17:22:5970 "webview-selective-image-inversion-darkening";
Michael Baifee012d2021-08-11 17:13:2471
Rupert Ben Wiser85a35a452024-01-24 16:55:5072// Enables FencedFrames. This also enables PrivacySandboxAdsAPIsOverride.
Kevin McNee348df782023-01-19 19:58:1373const char kWebViewFencedFrames[] = "webview-fenced-frames";
Ian Vollick6d6259f2022-05-11 01:59:2174
Rupert Ben Wiser70f8cda2024-01-11 19:18:0075// Enables downloading TpcdMetadataComponentInstallerPolicy by the component
76// updater downloading service in nonembedded WebView.
77const char kWebViewTpcdMetadaComponent[] = "webview-tpcd-metadata-component";
78
Rupert Ben Wiser0487551a2024-02-08 14:56:2079// Enables downloading FirstPartySetsComponentInstallerPolicy by the component
80// updater downloading service in nonembedded WebView.
81const char kWebViewFpsComponent[] = "webview-fps-component";
82
Alex Kallam23d1f3f2025-05-08 01:18:5083// Enables downloading MaskedDomainListComponentInstallerPolicy by the component
84// updater downloading service in nonembedded WebView.
85const char kWebViewMaskedDomainListComponent[] =
86 "webview-masked-domain-list-component";
87
Rupert Ben Wiser64bd01c2024-02-15 17:39:5288// Force disables 3rd party cookie for all apps.
89const char kWebViewForceDisable3pcs[] = "webview-force-disable-3pcs";
90
Adam Wallsca6da2c22024-03-18 21:47:0891// Enables crashes during WebView startup in the Java layer
92const char kWebViewForceCrashJava[] = "webview-force-crash-java";
93
94// Enables crashes during WebView startup in the Native layer
95const char kWebViewForceCrashNative[] = "webview-force-crash-native";
96
Alex Mitrabb49e802024-05-16 21:50:1197// Use WebView's context for resource lookups instead of the embedding app's.
98const char kWebViewUseSeparateResourceContext[] =
99 "webview-use-separate-resource-context";
100
Ashley Newsonac96c5f42024-06-26 20:03:33101// Override and enable features useful for BSA library testing/debugging.
102const char kDebugBsa[] = "debug-bsa";
Ashley Newsone9033062024-05-28 16:42:09103
Chidera Olibie40f4d45bf2025-03-24 13:30:27104// 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.
109const char kWebViewUseStartupTasksLogic[] = "webview-use-startup-tasks-logic";
110
Chidera Olibie20b3c2f42025-07-03 10:08:17111// Enables phase 2 of using startup tasks logic for webview chromium
112// initialization which also starts browser processes asynchronously, when
113// starting webview asynchronously.
114const char kWebViewUseStartupTasksLogicP2[] =
115 "webview-use-startup-tasks-logic-p2";
116
Chidera Olibiea9f2e5052025-07-09 18:53:47117// Enables running native startup tasks asynchronously if WebView startup is
118// asynchronous.
119const char kWebViewStartupTasksYieldToNative[] =
120 "webview-startup-tasks-yield-to-native";
[email protected]8a592802014-07-02 07:31:33121} // namespace switches