The HTML5 container has many switch configurations. You can modify these configurations to change the container's behavior. For example, you can use the signature verification configuration to enable or disable offline package signature verification.
You can modify switch configurations in one of the following three ways:
Add the built-in
custom_config.jsonfile to theconfigfolder in theassetsdirectory of the portal project or the main application project. This method applies only to version 10.1.60 and later. The file format ofcustom_config.jsonis as follows:[ { "value": "NO", "key": "h5_shouldverifyapp" }, { "value": "0", "key": "TSBS" } ]Use
H5ExtConfigProviderto configure switches in your code. This method applies only to versions earlier than 10.1.60. The usage ofH5ExtConfigProvideris as follows:public class H5ExtConfigProviderImpl implements H5ExtConfigProvider { @Override public String getConfig(String key) { if ("h5_shouldverifyapp".equalsIgnoreCase(key)) { return "YES"; } else if ("TSBS".equalsIgnoreCase(key)) { return "0"; } return null; } } // Call this method at startup. Only one global instance of H5ExtConfigProvider can be active. The last instance that is set takes precedence. H5Utils.setProvider(H5ExtConfigProvider.class.getName(), new H5ExtConfigProviderImpl());Distribute switch configurations from the MDS platform. For more information, see Switch configuration management.
List of container switches
Use the switches in the following table to customize which features are enabled.
Switch name | Purpose | Description | Default value |
| Enables or disables signature verification. Enable this feature for online environments. If a device is detected as rooted, signature verification is forcibly enabled and this switch configuration is ignored. | Set to YES to enable the feature. Set to NO to disable it. | YES |
| Specifies whether to use the immersive title bar. This switch applies only to Android. | Set to `1` to use it. Set to `0` not to use it. Important The values `1` and `0` are strings. | 1 |
| The remote server address for app debugging on remote devices. |
| - |
| Specifies whether to use the mPaaS network library to load fallback resources. | Set to YES to use the mPaaS network library to load fallback resources. Set to NO to use the system network library to load fallback resources. | YES |
| Specifies whether to forcibly start a new Activity when `pushWindow` is called. | Set to YES to enable this feature. Other values disable it. | NO |
| Specifies whether to display the options menu in the upper-right corner of a miniapp. Note This configuration takes effect only when you choose whether to display the options menu in the upper-right corner during miniapp publishing. | Set to YES to display the menu. Other values hide it. | NO |
| Specifies whether to display the share option in the options menu in the upper-right corner of a miniapp. | Set to YES to display the option. Other values hide it. | NO |
| Specifies whether a miniapp uses the built-in navigation bar. | A value of YES indicates that the item is in use. Any other value indicates that it is not. | YES |
| A whitelist of domain names. Offline resources from the whitelisted domain names can be accessed cross-domain. Note For online resources, configure the correct cross-domain settings on the resource server. | The content format is a JSON array. Special characters must be escaped. Example: | Empty |
| Allows Mixed Content mode. Enabling this mode poses a security risk. Use with caution. Note This switch is supported only in version 10.1.60. | Set to YES to allow the mode. Set to NO to disallow it. | NO |