changeAppUserSettings method
- String manifestId, {
- bool? linkCapturing,
- DisplayMode? displayMode,
Changes user settings of the web app identified by its manifestId. If the app was not installed, this command returns an error. Unset parameters will be ignored; unrecognized values will cause an error.
Unlike the ones defined in the manifest files of the web apps, these settings are provided by the browser and controlled by the users, they impact the way the browser handling the web apps.
See the comment of each parameter.
linkCapturing
If user allows the links clicked on by the user in the app's scope, or
extended scope if the manifest has scope extensions and the flags
DesktopPWAsLinkCapturingWithScopeExtensions
and
WebAppEnableScopeExtensions
are enabled.
Note, the API does not support resetting the linkCapturing to the initial value, uninstalling and installing the web app again will reset it.
TODO(crbug.com/339453269): Setting this value on ChromeOS is not supported yet.
Implementation
Future<void> changeAppUserSettings(String manifestId,
{bool? linkCapturing, DisplayMode? displayMode}) async {
await _client.send('PWA.changeAppUserSettings', {
'manifestId': manifestId,
if (linkCapturing != null) 'linkCapturing': linkCapturing,
if (displayMode != null) 'displayMode': displayMode,
});
}