The appearance and action of the HTML5 container during running are controlled by a group of parameters. The startup parameters can be specified when you start a new instance or call pushWindow, for example:
alipays://platformapi/startapp?appId=20000067&url=http%3A%2F%2Fm.taobao.com&showOptionMenu=NO&startMultApp=YES
In addition, the first URL of a new instance can carry a magic parameter webview_options
. The content will be fetched by the container and transferred to the container.
?webview_options=showOptionMenu%3DNO&startMultApp%3DYES
// urlencode('showOptionMenu=NO&startMultApp=YES') => showOptionMenu%3DNO&startMultApp%3DYES
The startup parameters passed through by the client can be obtained by the frontend through AlipayJSBridge.startupParams
or jsapi:getStartupParams
.
Name | Abbreviation | Type | Description | Default value | pushWindow available | Remarks |
---|---|---|---|---|---|---|
url | - | String | Start URL. | “” | Y | |
defaultTitle | dt | String | Default title, displayed on the title bar before the page is loaded for the first time. | “” | Y | |
showLoading | sl | String | Whether to display the global loading animation before the page is loaded. The values include YES and NO. | “NO” | Y | |
readTitle | rt | String | Whether to read the page title and display it on the title bar. The values include YES and NO. | “YES” | Y | |
bizScenario | bz | String | Business scenario source. The value will be recorded in each event tracking to distinguish different sources. | “” | - | |
backBehavior | bb | String | Action of the Back button. The values include back, pop, and auto. back : Return to the previous page if browser history exists. Otherwise, the current WebView is closed. pop: Close the current window. auto: Equivalent to pop in iOS. In Android, this action value is equivalent to back when the toolbar is visible and is equivalent to pop when the toolbar is invisible. | The default value is “back” in general browser mode for a non-HTML5 app (app ID: 20000067), and is “pop” for an HTML5 app (started using startApp). | - | |
pullRefresh | pr | String | Whether pull-down refresh is supported. Valid values: YES and NO. The value can be set to YES for only local files. | “NO” | Y | |
showProgress | sp | bool | Whether to display the loading progress bar. The values include YES and NO. | “NO” | - | |
canPullDown | pd | String | Whether the screen supports slide-down (to show the black background or domain name). The values include YES and NO, and can be set to NO for only local files. | “YES” | YES | |
showDomain | sd | bool | Whether to display the domain name when the screen is slid down. The values include YES and NO. It can be set to NO only for local files, and is forcibly set to NO for offline packages, not allowed to display the domain name. | “YES” | - | |
backgroundColor | bc | int | Background color (in decimal, for example, bc=16775138). | “” | - | |
showOptionMenu | so | bool | Whether to display the ellipsis (…) on the upper right. The values include YES and NO. | The default value is NO for HTML5 apps and YES for non-HTML5 apps. | ||
showTitleLoading | tl | bool | Whether to display the small loading animation on the left side of the title bar. The values include YES and NO. | NO | Y | |
enableScrollBar | es | bool | Whether to use the WebView scrollbars, including the vertical and horizontal ones. This parameter is valid only for Android. | “YES” | - |