You can use a set of parameters to control the behaviours and appearance of H5 Container, and pass the parameters when creating a new instance of H5 Container, or using pushWindow API, for example:
?__webview_options__=showOptionMenu%3dYES
// urlencode('showOptionMenu=YES') => showOptionMenu%3dYES
In addition, you can specify a variable parameter __webview_options__ in the first URL of the new instance, its content will be extracted and used by the H5 Container
The web app can use AlipayJSBridge.startupParams
or jsapi:getStartupParams
to obtain the start-up parameters from native client app.
Warning. Due to compatibility issue of the memory buffer in iOS platform, it is possible to receive a cached value from previous page visit via startupParams
environment variable in edge cases. Please avoid using start-up parameters to pass important parameters that could affect the business logic
It is a long table, please scroll to right to see more
Name | Abbreviation | Type | Description | Default | Available in pushWindow | Remarks |
---|---|---|---|---|---|---|
url | string | Initial URL | "" | Y | ||
defaultTitle | dt | string | Default title in initial page load | "" | Y | |
showLoading | sl | string | YES/NO, Whether or not to display loading spinner | "NO" | Y | |
readTitle | rt | string | YES/NO, Whether or not to display webpage title in titleBar | "YES" | Y | |
bizScenario | bz | string | Business scenario, this value is used in logging to differentiate various sources | "" | - | |
backBehavior | bb | string | back/pop/auto. The behaviour when back button is pressed back: history.length > 0 ? history.back() : closeWebview() pop: popWindow() auto: equivalent to pop in iOS pop;In Android,equivalent to back when toolbar is visible, and pop otherwise. | "back" | - | since 8.1 |
pullRefresh | pr | string | YES / NO. Whether or not to support pull to refresh | "NO" | Y | since 8.2 |
toolbarMenu | tm | string | An JSON string that specifies additional menu items. e.g., {"menus":[{"name":"Foo","icon":"H5Service.bundle/h5_popovermenu_share","action":"hello"},{"name":"Bar","icon":"H5Service.bundle/h5_popovermenu_abuse","action":"world"}]} | "" | Y | since 8.2 |
showProgress | sp | bool | YES/NO,Whether or not to display loading progress bar | "NO" | - | since 8.2 |
canPullDown | pd | string | YES/NO,Whether or not to support pull down Obsoleted since 9.9.5, Use 'allowsBounceVertical'instead | "YES" | YES | Android since 8.3 iOS since 8.4 |
showDomain | sd | bool | YES/NO,Whether or not to show the domain name | "YES" | - | Android since 9.0.1 iOS since 9.0 |
backgroundColor | bc | int | Background colour(In decimal format, e.g., bc=16775138) | "" | - | since 8.4 |
showOptionMenu | so | bool | YES/NO,whether or not to show the option menu | NO for H5 App YES for non-H5 App | since 8.4 | |
showTitleLoading | tl | bool | YES/NO,Whether or not to show the title loading spinner | NO | Y | since 8.6 |
enableScrollBar | es | bool | YES/NO,Whether or not to enable both horizontal and vertical scroll bar in Webview, only applicable to Android | "YES" | - | since 9.2 |