All Products
Search
Document Center

Mobile Platform as a Service:Configure an HTML5 container

Last Updated:Jan 26, 2026

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.json file to the config folder in the assets directory of the portal project or the main application project. This method applies only to version 10.1.60 and later. The file format of custom_config.json is as follows:

    [
    {
      "value": "NO",
      "key": "h5_shouldverifyapp"
    },
    {
      "value": "0",
      "key": "TSBS"
    }
    ]
  • Use H5ExtConfigProvider to configure switches in your code. This method applies only to versions earlier than 10.1.60. The usage of H5ExtConfigProvider is 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

h5_shouldverifyapp

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

TSBS

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

h5_remote_debug_host

The remote server address for app debugging on remote devices.

  • If you configure this switch, app debugging on remote devices is enabled. Set the value of h5_remote_debug_host to the server address used for debugging.

  • If you do not configure this switch, app debugging on remote devices is disabled. This switch has no default value.

-

androidFallbackNetwork

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

mp_h5_push_window_use_activity

Specifies whether to forcibly start a new Activity when `pushWindow` is called.

Set to YES to enable this feature. Other values disable it.

NO

mp_ta_showOptionMenu

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

mp_ta_showShareMenuItem

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

mp_ta_use_orginal_mini_nagivationbar

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

h5_CORSWhiteList

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: { "value": "[\"oss-cn-hangzhou.aliyuncs.com\"]", "key": "h5_CORSWhiteList" }

Empty

mp_h5_allow_mix_content

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