JSAPI

Start-up Parameters

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

NameAbbreviationTypeDescriptionDefaultAvailable in pushWindowRemarks
urlstringInitial URL""Y
defaultTitledtstringDefault title in initial page load""Y
showLoadingslstringYES/NO, Whether or not to display loading spinner"NO"Y
readTitlertstringYES/NO, Whether or not to display webpage title in titleBar"YES"Y
bizScenariobzstringBusiness scenario, this value is used in logging to differentiate various sources""-
backBehaviorbbstringback/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
pullRefreshprstringYES / NO. Whether or not to support pull to refresh"NO"Ysince 8.2
toolbarMenutmstring 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"}]}
""Ysince 8.2
showProgressspboolYES/NO,Whether or not to display loading progress bar
"NO"-since 8.2
canPullDownpdstringYES/NO,Whether or not to support pull down
Obsoleted since 9.9.5, Use 'allowsBounceVertical'instead
"YES"YESAndroid since 8.3
iOS since 8.4
showDomainsdboolYES/NO,Whether or not to show the domain name"YES"-Android since 9.0.1
iOS since 9.0
backgroundColorbcintBackground colour(In decimal format, e.g., bc=16775138)
""-since 8.4
showOptionMenusoboolYES/NO,whether or not to show the option menuNO for H5 App
YES for non-H5 App
since 8.4
showTitleLoadingtlboolYES/NO,Whether or not to show the title loading spinner
NOYsince 8.6
enableScrollBaresboolYES/NO,Whether or not to enable both horizontal and vertical scroll bar in Webview, only applicable to Android"YES"-since 9.2