目录

Version Change History

Updates in Version 1103 (2022-12-26)

[h2]Functions

Change Point

Description

Using the Click Element on an HTML5 Page to Access a Quick App

Added the section "Using the Click Element on an HTML5 Page to Access a Quick App."

After the click element recommended by a quick app is used on an HTML5 page, users can tap the button to access the quick app.

For details, please refer to Using the Click Element on an HTML5 Page to Access a Quick App (1103+).

Version 1090 (2022-05-19)

[h2]Framework

Change Point

Description

Manifest file

Added parameters such as shareCurrentPage and shareParams to menuBarData to configure the share page.

For details, please refer to manifest.json File.

Script

  • Added the setMenubarData page method to dynamically set menuBarData.
  • Added the $attrs and $listeners attributes to common objects.
  • Added the setMeta attribute to the page methods.

For details, please refer to Script.

[h2]Elements

Change Point

Description

Animation styles

  • Added new supported types for animation-timing-function.
  • Added the animation-direction style.
  • Added background-position for @keyframes.

For details, please refer to Animation Styles.

<camera>

Added the startRecord and stopRecord methods.

For details, please refer to camera.

<image>

  • Added the filter style, which supports the blur filter mode.
  • Added the alt-object-fit style that specifies the scale type of a placeholder image.

For details, please refer to image.

<refresh2>

Added this element.

For details, please refer to refresh2 (1090+).

<refresh-footer>

Added this element.

For details, please refer to refresh-footer (1090+).

<refresh-header>

Added this element.

For details, please refer to refresh-header (1090+).

<section-list>

Added this element.

For details, please refer to section-list (1090+).

<section-group>

Added this element.

For details, please refer to section-group (1090+).

<section-header>

Added this element.

For details, please refer to section-header (1090+).

<section-item>

Added this element.

For details, please refer to section-item (1090+).

<slide-view>

Added this element.

For details, please refer to slide-view (1090+).

<web>

Added the capture attribute of the input tag on HTML5 pages.

For details, please refer to web.

[h2]APIs

Change Point

Description

app

Added the app.createQuickAppQRCode API to generate the QR code of the current quick app.

For details, please refer to App Context.

file

Added result codes 303 and 304 for the copyFileToPublicDir API.

For details, please refer to File Storage.

keyguard

Added this API.

For details, please refer to Screen Lock (1090+).

device

Added the deviceType parameters for the device.getInfo(OBJECT) API.

For details, please refer to Device Information.

animation

  • Added the backgroundPosition parameter for style.
  • Added the value steps for easing.

For details, please refer to Animations.

Version 1083 (2022-03-21)

[h2]Framework

Change Point

Description

Manifest file

Added the menuBar parameter to determine whether the menu bar is visible.

For details, please refer to manifest.json File.

Script

Added the themeMode, orientation, and foldScreenMode values for onConfigurationChanged.

For details, please refer to Script.

[h2]Elements

Change Point

Description

<shortcut-button>

Added this element to create a home screen shortcut.

For details, please refer to shortcut-button (1083+).

[h2]APIs

Change Point

Description

fetch

Added PATCH for method.

For details, please refer to Fetch.

device

Added the device.isFoldable method to check whether the device is foldable.

For details, please refer to Device Information.

configuration

  • Added the getThemeMode method to obtain the current theme of an app.
  • Add the getFoldableState method to obtain the current state of a foldable device.
  • Added the getScreenOrientation method to obtain the current screen orientation.

For details, please refer to App Configuration.

Version 1080 (2021-12-28)

[h2]Framework

Change Point

Description

Manifest file

  • Added the permissionDesc attribute to describe the reason for applying for permissions.
  • Added WRITE_EXTERNAL_STORAGE for the configuration of permissionDesc.

For details, please refer to manifest.json File.

UX files

Supported the style definition that takes effect globally.

For details, please refer to UX Files.

Script

  • Added the setSecure method to set whether to enable the anti-screenshot function.
  • Added the visible parameter to the setStatusBar method and added the setNavigationBar method.
  • Added the app lifecycle API onScreenChange.
  • Added the following app lifecycle APIs onReachTop, onPageScroll, and onReachBottom.

For details, please refer to Script.

[h2]Elements

Change Point

Description

Common styles

  • Supported the percentage format for the value of border-radius/border-[top|bottom]-[left|right]-radius.
  • Added auto as the default value for background-size in version 1080 or later.
  • Added the following attributes: min-width, max-width, min-height, and max-height.

For details, please refer to Common Styles.

<camera>

  • Removed the autoorientation attribute.
  • Added the cropimage method to set whether to crop photos based on the size of the camera element.
  • Added the framesize, autoexposurelock, and autowhitebalancelock attributes.
  • Added the cameraframe and camerainitdone events.
  • Added the setPreviewFpsRange, getSupportedPreviewFpsRange, getPreviewFpsRange, setExposureCompensation, getExposureCompensationRange, getExposureCompensation, and getSupportedSceneModes methods.

For details, please refer to camera.

<div>

Added the enablevideofullscreencontainer attribute to display the custom elements when the video is played in full screen.

For details, please refer to div.

<drawer>

Added this element.

For details, please refer to drawer.

<drawer-navigation>

Added this element.

For details, please refer to drawer-navigation.

<image>

  • Added the autoplay attribute.
  • Added the startAnimation and stopAnimation methods.

For details, please refer to drawer-navigation.

<rating>

Added the isFromUser parameter to indicate whether the current event is triggered by users' dragging.

For details, please refer to rating.

<refresh>

  • Added the description that versions earlier than 1040 do not support the click event.
  • Added the enable-refresh attribute. The default value is true. If the parameter value is not set, the default value will be used.

For details, please refer to refresh.

<slider>

  • Added the description that versions earlier than 1040 do not support the click event.
  • Added the isFromUser parameter to indicate whether the current event is triggered by users' dragging.

For details, please refer to slider.

<swiper>

  • Removed the restriction that the loop attribute takes effect only when there are more than two subelements.
  • Added the previousmargin and nextmargin attributes to set the front margin and back margin.
  • Added the enableswipe attribute.
  • Supported the animation switching on the page.

For details, please refer to swiper.

<video>

  • Added the titlebar and title attributes to determine whether to display the title bar and title when the video is played in full screen.
  • Added the description that the click event will not be triggered in versions earlier than 1040.
  • Added the playcount attribute to set the number of times a video should play.
  • Added a feature that custom elements can be displayed when video is played in full screen since version 1080.

For details, please refer to video.

<web>

  • Added the description that versions earlier than 1040 do not support the click event.
  • Added the initialscale attribute to set the initial scale of the web page.
  • Added the renamejsinterface attribute to modify the name of the API for the web element to communicate with HTML5 to avoid API name conflicts.
  • Added the parameters returned by pagestart.
  • Added the parameters returned by error.

For details, please refer to web.

[h2]APIs

Change Point

Description

router

Added the 5G setting page hap://settings/5g in the router.push API so this page can be opened through router.push.

For details, please refer to Page Routing.

decode

Added this API.

For details, please refer to Text Decoding.

prompt

Added showLoading and hideLoading to display or close the loading pop-up.

For details, please refer to Pop-up.

webview

  • Added new CCT capabilities.
  • Added the launchFlag parameter to set the mode for using Custom Tabs of the browser.

For details, please refer to Web Page Opening.

fetch

Added Referer to header.

For details, please refer to Fetch.

request

Changed the type of token from number to string.

For details, please refer to Upload and Download.

uploadtask

Added this API for creating an upload request and listening to the upload process.

For details, please refer to Upload Task.

downloadtask

Added this API for creating a download request and listening to the download process.

For details, please refer to Download Task.

requesttask

Added this new API for creating a network request and listening to the request process.

For details, please refer to Request Task.

file

  • Added copyFileToPublicDir to copy files to the system public directory.
  • Added methods for file.list, file.get and file.access to access the resource folder.

For details, please refer to File Storage.

exchange

Added the function of allowing authorized apps to write and delete data through the exchange APIs.

For details, please refer to Data Exchange.

geolocation

  • Added geocodeQuery to obtain the longitude and latitude of a location.
  • Added reverseGeocodeQuery to obtain detailed address information including province and city for a location.

For details, please refer to Location.

network

Added getNetworkOperator to obtain the carrier of the network visited by a SIM card.

For details, please refer to Network Status.

device

  • Added toLocaleDateTimeString, toLocaleDateString, and toLocaleTimeString to convert a timestamp to a string in the same format as the system date.
  • Modified the fixed value of mac returned by device.getId since version 3.1.2.310.
  • Added the vendorOsName and vendorOsVersion parameters in the device.getInfo(OBJECT) API.

For details, please refer to Device Information.

volume

Supported the value parameter in the setMediaValue method.

For details, please refer to System Volume.

bluetooth

Added getDevicesBattery to obtain the battery level of Huawei Bluetooth earphones.

For details, please refer to Bluetooth.

texttoaudio

Added this API.

For details, please refer to Text to Speech.

telecom

Added this API.

For details, please refer to Communication.

media

Added the folderName parameter to the saveToPhotosAlbum method.

For details, please refer to Multimedia.

animation

Added the value cubic-bezier for easing.

For details, please refer to Animations.

canvas

  • Added the suggestion that the area to be cleared must be larger than or the same as the canvas when the clearRect API is called.
  • Changed the function of the shadowBlur parameter since version 1078.
  • Added the restriction that PDF canvas drawing with anti-aliasing is not supported if globalCompositeOperation is set.

For details, please refer to Canvas.

video

Added new APIs for videos.

For details, please refer to Video.

cipher

  • Added getRandomValues to obtain random numbers.
  • Added the input, secretKey, and initialVector parameters to cipher.aes(OBJECT) and the output parameter for returning values.

For details, please refer to Cryptographic Algorithm.

account

Added the forceLogin parameter to account.authorize(OBJECT).

For details, please refer to Account Kit.

pay (3.0)

  • Added this API for supporting the test for subscription and sandbox.
  • Changed the type of data returned by the fail callback from object to string.

For details, please refer to IAP 3.0.

ad

  • Added this API for implementing native ads and rewarded ads.
  • Added the consent API.
  • Added the source parameter to nativeAd.onLoad to identify the ad source.
  • Added the startDownload, resumeDownload, pauseDownload, cancelDownload, getDownloadProgress, getAppStatus, onStatusChanged, offStatusChanged, onDownloadProgress, and offDownloadProgress methods to download and install the advertiser app of a native ad.
  • Added methods for banner ads.
  • Added methods for interstitial ads.

For details, please refer to Ads Kit.

keyring

Added this API.

For details, please refer to User Credential (1079+).

ml.asr

Added this API for implementing the automatic speech recognition function provided by ML Kit.

For details, please refer to Automatic Speech Recognition (1077+).

ml.translate

Added this API for implementing the text translation function provided by ML Kit.

For details, please refer to Text Translation (1077+).

[h2]Functions

Change Point

Description

Card development

Added restriction description for the video element.

For details, please refer to Developing a Card.

Integration with Push Kit

Increased the number of messages (at most five messages now) that a quick app can push to the same user.

For details, please refer to Integrating Push Kit.

Version 1070 (2020-05-19)

[h2]Framework

Change Point

Description

Manifest file

  • Added the recreateOnFolding parameter to config to determine whether to load the page when the foldable screen is unfolded.
  • Added the auto option for the orientation parameter of display to enable the page to adapt to the landscape or portrait orientation of the system.
  • Deprecated the menu setting in display to unify the menu of quick apps.
  • Added the menuBarData parameter to display to set the page menu style.

For details, please refer to manifest.json File.

Script

  • Added the scrollBy and scrollTo methods to the page object $page to control page scrolling.
  • Added the following app lifecycle methods: onRequest, onShow, and onHide.

For details, please refer to Script.

[h2]Elements

Change Point

Description

Common events

Added the common events animationstart, animationiteration, and animationend to control CSS animations.

For details, please refer to Common Events.

Public methods

  • Added the common method addEventListener for listening to CSS animation events.
  • Added the common method toTempFilePath to save element content as an image.
  • Added the common method getBoundingClientRect to obtain the layout of the current element.

For details, please refer to Public Methods.

Animation styles

Supported the percentage format for the @keyframes attribute of the animation styles.

For details, please refer to Animation Styles.

<camera>

Added the autoorientation attribute to indicate whether to enable auto-rotate.

For details, please refer to camera.

<list>

  • Added the scrollBy attribute to control the list to slide from the current position.
  • Added the behavior attribute to the scrollTo method to determine whether to perform smooth scrolling.
  • Added the layout-type style to control whether subelements are displayed in grid or waterfall mode.

For details, please refer to list.

<list-item>

Supported the column-span style, which adapts to different layout-type settings of list, and controls the number of columns occupied by list-item in list.

For details, please refer to list-item.

<progress>

Added the layer-color style to control the background color of the progress bar.

For details, please refer to progress.

<richtext>

Added the start and complete events to listen to richtext loading start and complete instances.

For details, please refer to richtext.

<switch>

Added the thumb-color and track-color styles to control the color of the slider and guide rail.

For details, please refer to switch.

<video>

Added the orientation attribute to control the page direction when the video enters the full screen mode.

For details, please refer to video.

<web>

  • Added the supportzoom attribute to determine whether web pages can be zoomed in or out on.
  • Added the showloadingdialog attribute to determine whether to display the loading progress bar.
  • Added the algorithmsforlayout, wideviewport, and overviewmodeinload attributes to support the transparent transmission of the WebView, helping you adapt to the display effect on mobile phones.
  • Added the multiwindow, jumppolicy, and openinbrowserurl attributes to control the multi-window behavior of the web element.
  • Added the xrequestedwithpolicy attribute to specify the value of x-requested-with in the header of an HTTP/HTTPS request sent by the web element.

For details, please refer to web.

[h2]APIs

Change Point

Description

router

  • Added the getPages method to obtain the current page stack list.
  • Added the ___PARAM_LAUNCH_NATIVE_FLAG___ parameter to params of router.push. This parameter is used to add a flag when a native app is opened.
  • Added the ___PARAM_PAGE_ANIMATION___ parameter to control the animation type during page redirection.

For details, please refer to Page Routing.

resident

Added APIs to control the background running status of a quick app.

For details, please refer to Background Running.

webview

Added the showloadingdialog attribute to loadUrl to determine whether to display the loading progress bar.

For details, please refer to Web Page Opening.

notification

  • Added the postDelayedShow method to set notification delay.
  • Added the cancelDelayedShow method to cancel notification delay.

For details, please refer to Notification.

sensor

Added the accuracy parameter to the subscribeCompass callback function to obtain the sensor precision.

For details, please refer to Sensor.

geolocation

  • Added the openLocation method to view a location in the built-in map of the quick app.
  • Added the chooseLocation method to open the map and select a location.

For details, please refer to Location.

network

  • Added the getSimOperator method to obtain the carrier information of the SIM card.
  • Added the return values 5g, bluetooth, and other for the type parameter of the subscribe method.

For details, please refer to Network Status.

device

Added the getCountryCode method to obtain the country/region where the HUAWEI ID is registered on Quick App Center.

For details, please refer to Device Information.

configuration

  • Added the getLayoutDirection method to obtain the language direction of the current system.
  • Added the setScreenOrientation method to set the screen orientation.
  • Added the formatDateAndTime and simpleFormatDate methods to convert a timestamp to a time string in the required format.

For details, please refer to App Configuration.

ad

Added this API for implementing native ads and rewarded ads.

For details, please refer to Ads Kit.

Version 1060 (2019-12-10)

[h2]Framework

Change Point

Description

Manifest file

  • Added trustedSslDomains to configure trusted HTTPS sites.
  • Added the errorPage parameter to router to customize the error page. If this parameter is not set, the default error page is displayed when an exception occurs.
  • Added the network field to config to support network timeout.
  • Added the capability of setting designWidth to device-width.

For details, please refer to manifest.json File.

Script

  • Added the query attribute to the page object $page to obtain page parameters. Added the lifecycle method onConfigurationChanged for listening to the configuration changes of an app.
  • Added the onPageNotFound method, which is triggered when the error page is redirected to.

For details, please refer to Script.

[h2]Elements

Change Point

Description

General settings

Added the getViewId method to obtain nodeId of an element.

For details, please refer to Public Methods.

<image>

Since this version, if no placeholder image is set, Huawei Quick App Engine uses a placeholder image whose color is #ccc (gray) by default. If you do not want to use the default placeholder image, set alt to blank.

For details, please refer to image.

<input>

Added the caret-color style to customize the cursor color.

For details, please refer to input.

<list>

Added the smooth attribute to the scrollTo method to enable smooth page scrolling.

For details, please refer to list.

<list-item>

Resolved the problem of DOM structure inconsistency when if and for are used in list-item.

For details, please refer to list-item.

<textarea>

Added the onlinechange event to listen to the change of the number of lines in the text box.

For details, please refer to textarea.

[h2]APIs

Change Point

Description

file

  • Added the recursive parameter to get, indicating whether to recursively obtain the file list of subdirectories. Added the return parameters type and subFile, respectively indicating the file type and file list.
  • Added the append parameter to writeText and writeArrayBuffer, indicating whether the append mode is used.
  • Added the access, mkdir, and rmdir methods.

For details, please refer to File Storage.

sensor

Added the interval parameter to subscribeAccelerometer to set the execution frequency of the listener callback function.

For details, please refer to Sensor.

device

  • Added the marketingName parameter to getInfo and getInfoSync, indicating the marketing name of a device model.
  • Added the getServiceCountryCode method to obtain the service country or region of Huawei Quick App Center.
  • Added the getOAID method to obtain the OAID.

For details, please refer to Device Information.

brightness

Added the setKeepScreenOn method to set whether to keep the screen steady on.

For details, please refer to Screen Brightness.

configuration

Added APIs to set and obtain the current language environment.

For details, please refer to App Configuration.

zip

Added an API to decompress files.

For details, please refer to Compression/Decompression.

media

  • Added the return parameters name and size for the takePhoto, takeVideo, pickImage, pickVideo, and pickFile methods to obtain the file name and size respectively.
  • Added the pickImages, pickVideos, and pickFiles methods.

For details, please refer to Multimedia.

pay

Added the methods productPay, getProductDetails, getPurchaseInfo, and getOrderDetail to support PMS payment.

For details, please refer to IAP 3.0.

Version 1050 (2019-09-20)

[h2]Framework

Change Point

Description

Manifest file

  • Added the launchMode attribute to declare the page launch mode.
  • Added the statusBarImmersive, statusBarTextStyle, statusBarBackgroundColor, and statusBarBackgroundOpacity attributes to set the immersive title bar and its style.

For details, please refer to manifest.json File.

Template

Supported the custom filter.

For details, please refer to Template.

Script

  • Added the calculation attribute to page-level elements.
  • Added the statusBarHeight attribute to the page object $page to obtain the height of the status bar on the current page. Added the windowWidth attribute to obtain the visible window width of the current page. Added the windowHeight attribute to obtain the visible window height of the current page.

For details, please refer to Script.

[h2]Elements

Change Point

Description

General settings

Added the offsetX and offsetY attributes for the touches object.

For details, please refer to Common Events.

<slider>

Added the block-color style to set the color of the slider.

For details, please refer to slider.

<slot>

Added an element to set the default content and support named slots.

For details, please refer to slot.

<span>

Supported the nested span element.

For details, please refer to span.

<stack>

Added the fullscreenchange event, which is triggered when a user enters or exits the full-screen mode. Added the requestFullscreen method to request to enter the full-screen mode.

For details, please refer to stack.

<video>

Added the requestFullscreen method to request to enter the full-screen mode.

For details, please refer to video.

[h2]APIs

Change Point

Description

app

Added app.getPackageInfo to obtain information about local apps.

For details, please refer to App Context.

router

Added the quick app launch parameter ___PARAM_LAUNCH_FLAG___ to router.push.

For details, please refer to Page Routing.

storage

Added the key method to obtain the key name corresponding to an index.

For details, please refer to Data Storage.

exchange

Added an API for data exchange between a data publisher and the quick app.

For details, please refer to Data Exchange.

device

Added emuiApiLevel to device.getInfo to obtain the API level of the system.

For details, please refer to Device Information.

canvas

Added the toTempFilePath method to export content in a specified area of the current canvas to an image of a specified size.

For details, please refer to Canvas.

audio

Added the getPlayState method to obtain the current playback status.

For details, please refer to Audio.

account

Added the account.isLogin API to check whether a HUAWEI ID has been signed in.

For details, please refer to Account Kit.

Version 1045

[h2]Framework

Change Point

Description

Script

Added the public method getApp.

For details, please refer to Script.

[h2]Elements

Change Point

Description

General attributes

Added the data attribute.

For details, please refer to General Attributes.

<marquee>

Added the marquee element to set a text marquee.

For details, please refer to marquee.

[h2]APIs

Change Point

Description

app

Added icon and packageName to app.getInfo to obtain the app icon path and package name.

For details, please refer to App Context.

sensor

Added the sensor.subscribeStepCounter and sensor.unsubscribeStepCounter APIs to listen to and cancel listening to pedometer sensor data respectively.

For details, please refer to Sensor.

device

Added the device.getSerial API to obtain the device serial number. The device.getId, device.getDeviceId and device.getUserId APIs cannot obtain data if the operating system version is 10.0 or later.

For details, please refer to Device Information.

mediaquery

Added this API to implement the responsive layout capability.

For details, please refer to MediaQuery.

Version 1040 (2019-06-24)

[h2]Framework

Change Point

Description

Script

Added the method for obtaining the orientation.

For details, please refer to Script.

[h2]Elements

Change Point

Description

<swiper>

  • Added the duration and vertical attributes.
  • Added the top|left|right|bottom style, which is used to set the position of the indicator relative to the swiper.

For details, please refer to swiper.

<web>

Added the function of allowing users to choose an image, video, or audio file or launch the camera, video recording, or audio recording page through input on HTML5 pages.

For details, please refer to web.

[h2]APIs

Change Point

Description

device

  • Added the return parameters timeZone, emuiVer, fontScale, characteristics, windowLogicWidth, and windowLogicHeight to the device.getInfo API.
  • Added the getInfoSync and onFontScaleChange APIs.

For details, please refer to Device Information.

bluetooth

Added the support for Bluetooth.

For details, please refer to Bluetooth.

image

Added the image.pickColor API to obtain the code of the background or floating text color.

For details, please refer to Image Processing.

canvas

Deleted the x1, y1, and r1 parameters from canvas.createRadialGradient.

For details, please refer to Canvas.

[h2]Functions

Change Point

Description

Integration with Push Kit

Added a field indicating whether to vibrate or display the breathing indicator upon arrival of a notification message.

For details, please refer to Integrating Push Kit.

Version 1035

[h2]Elements

Change Point

Description

Common events

Added the resize event.

For details, please refer to Common Events.

<camera>

Added the camera element.

For details, please refer to camera.

<div>

Added row-reverse and column-reverse for the flex-direction style.

For details, please refer to div.

<image>

Added object-fit to override the resize-mode style.

For details, please refer to image.

<list>

Added row-reverse and column-reverse for the flex-direction style, and added the scrollend and touchup events.

For details, please refer to list.

[h2]APIs

Change Point

Description

router

Added the uri parameter to router.push. So users can be redirected to another page, permission management page of a quick app, or the location management page of the mobile phone.

For details, please refer to Page Routing.

webview

Added the sample code.

For details, please refer to Web Page Opening.

storage

Changed the value of data to success for the success callback of the storage.set, storage.clear, and storage.delete APIs in 1035 and later versions.

For details, please refer to Data Storage.

file

Added the support for the tmp type for uri in file.get.

For details, please refer to File Storage.

geolocation

Added the accuracy and time parameters to the success callback of the geolocation.getLocation and geolocation.subscribe APIs.

For details, please refer to Location.

device

Added the screenDensity parameter to the success callback of the device.getInfo API.

For details, please refer to Device Information.

alarm

Added this API to set an alarm clock.

For details, please refer to Alarms.

media

  • Added the setRingtone and getRingtone APIs to set an alarm clock.
  • Added the previewImage API for you to preview images.

For details, please refer to Multimedia.

image

Added the getExifAttributes and setExifAttributes APIs for you to set and obtain Exif data of images.

For details, please refer to Image Processing.

canvas

Added descriptions about the getLineDash API and how to use the image object to draw images.

For details, please refer to Canvas.

audio

Added the streamType attribute to set the audio type.

For details, please refer to Audio.

Version 1030 (2018-10-31)

[h2]Framework

Change Point

Description

Page methods in a script

Added the descriptions of the name, component, and path methods to obtain the page name, element, and path from the manifest file.

For details, please refer to Page Methods.

App lifecycle APIs in a script

Added the onError API, which is called when an app error occurs.

For details, please refer to App Lifecycle APIs.

Manifest file

Added the orientation attribute to display to set the page to landscape or portrait mode.

For details, please refer to display in the manifest file description.

[h2]Elements

Change Point

Description

font-face style

Added the font-face style so that you can use an existing font file to set custom fonts.

For details, please refer to font-face Style.

<canvas>

Added the canvas element to define a canvas where you can draw.

For details, please refer to canvas.

<image>

Added the support for SVG images in the src attribute. (Animated images and filters are not supported currently).

For details, please refer to image.

<input>

Added the function of allowing dynamic modification of the type attribute.

Added the font-family style. Default fonts normal, sans-serif, serif, and monospace are supported. You can change the font by setting this style.

Added 500, 600, 700, 800, 900, and bolder for the font-weight style. Only bolder among them will bold strings.

Added the selectionchange event, which is triggered when the selected string in the input element changes.

For details, please refer to input.

<option>

  • Added the font-family style. Default fonts normal, sans-serif, serif, and monospace are supported. You can change the font by setting this style.
  • Added 500, 600, 700, 800, 900, and bolder for the font-weight style. Only bolder among them will bold strings.

For details, please refer to option.

<select>

Added the font-family style. Default fonts normal, sans-serif, serif, and monospace are supported. You can change the font by setting this style.

For details, please refer to select.

<span>

  • Added the font-family style. Default fonts normal, sans-serif, serif, and monospace are supported. You can change the font by setting this style.
  • Added 500, 600, 700, 800, 900, and bolder for the font-weight style. Only bolder among them will bold strings.

For details, please refer to span.

<text>

  • Added the font-family style. Default fonts normal, sans-serif, serif, and monospace are supported. You can change the font by setting this style.
  • Added 500, 600, 700, 800, 900, and bolder for the font-weight style. Only bolder among them will bold strings.

For details, please refer to text.

<textarea>

  • Added the font-family style. Default fonts normal, sans-serif, serif, and monospace are supported. You can change the font by setting this style.
  • Added 500, 600, 700, 800, 900, and bolder for the font-weight style. Only bolder among them will bold strings.
  • Added the selectionchange event, which is triggered when the selected string in the textarea element changes.

For details, please refer to textarea.

<video>

Added the muted attribute to determine whether to mute a video during playback.

For details, please refer to video.

<web>

  • Added the allowthirdpartycookies parameter to specify whether cookies can be passed across domains.
  • Added the support for full-screen video playback in the web element. Added the function of allowing you to add the Back button if the web element does not provide this button so that users can tap the Back button to exit the full-screen mode.

For details, please refer to web.

[h2]APIs

Change Point

Description

webview

Added the allowthirdpartycookies parameter to webview.loadUrl to specify whether cookies can be passed across domains.

For details, please refer to Web Page Opening.

fetch

Added the ArrayBuffer type for the data parameter in fetch.fetch, and added the responseType parameter to enhance your control on the returned data type.

For details, please refer to Fetch.

shortcut

Added the message parameter to shortcut.install. When creating a shortcut on the home screen, you can set a more specific prompt message to increase the creation success rate.

For details, please refer to Home Screen Icon.

device

Added the platform object, in which the versionCode attribute can be used to obtain the platform version number.

For details, please refer to Device Information.

canvas

Added this API to draw images on the canvas and perform operations on the images.

For details, please refer to Canvas.

vibrator

Extended a parameter for the vibrate API to support both long and short vibrations. In earlier versions, the API can only trigger long vibrations that last for 1 second.

For details, please refer to Vibration.

Version 1020 (2018-06-20)

[h2]Elements

Change Point

Description

Common events

Added the description of the target and touches object attributes.

For details, please refer to Common Events.

Common styles

Added the support for network images in the background-image parameter.

For details, please refer to Common Styles.

<div>

Added space-around for the justify-content style.

For details, please refer to div.

<refresh>

Added the type attribute to the refresh element to implement pull-to-refresh of the refresh element. The default value of type is material. If the attribute is not set, the default value is used.

For details, please refer to refresh.

<image>

Added the support for the complete and error events so you can process the image loading success and failure in the event callback.

For details, please refer to image.

<text>

Added the letter-spacing style to the <text> element so that letter spacing can be set in this element.

For details, please refer to text.

<web>

  • Added the file download function. After you use the web element to open a page and click the download link, a pop-up is displayed, prompting the user to download the content. The downloaded content is saved to the Download folder on the SD card.
  • Added the message attribute. The onmessage event and postMessage method can be used to implement two-way data communication between web pages and quick apps.

For details, please refer to web.

[h2]APIs

Change Point

Description

router

Added the path and delta parameters to router.back so that you can return multiple pages by calling the API once.

For details, please refer to Page Routing.

prompt

Added the image and gravity parameters to prompt.showToast for you to customize toast images and their positions.

For details, please refer to Pop-up.

webview

Added the file download function to the WebView. Users can tap the download link to download files to the Download folder on the SD card.

For details, please refer to Web Page Opening.

websocket

Added this API for WebSocket communication.

For details, please refer to websocket.

shortcut

Added the systemPromptEnabled attribute to control whether the system prompts users to create a home screen icon.

For details, please refer to Home Screen Icon.

device

Added the return parameters windowWidth, windowHeight, statusBarHeight, and pixelRatio to the device.getInfo(OBJECT) API.

For details, please refer to Device Information.

animation

Added this API for using the animation effect in elements.

For details, please refer to Animations.

audio

Added the stop method to stop audio playback.

For details, please refer to Audio.

account

  • Added the openid, unionid, nickname, and avatar values returned by the account.authorize API.
  • Added the account.checkUserSession API to check whether the sign-in status of a user is valid.

For details, please refer to Account Kit.

Version 1010 (2018-04-20)

[h2]Framework

Change Point

Description

Page-level elements in a script

Added the support for Object types to props in the custom element, which can be used for detecting and verifying the type and setting its default value.

For details, please refer to Page-Level Elements.

[h2]Elements

Change Point

Description

Common events

You can bind a touch event to an element to implement function processing after a user touches the element.

For details, please refer to Common Events.

Common styles

  • Added the support for the .9.png images in background-image. You can set a .9.png image as the element background.
  • Added the background-position style to locate the background image.

For details, please refer to Common Styles.

<div>

  • Added the support for the active pseudo-class.
  • Added align-self to the flex layout style. You can define the vertical axis alignment mode of the flex subelement.

For details, please refer to div.

<image>

Added the support for the active pseudo-class.

<input>

  • Added the support for the active pseudo-class.
  • Added the maxlength and enterkeytype attributes and the select, setSelectionRange, and getSelectionRange methods.
  • Added the function of allowing you to set the maxlength attribute to control the maximum number of characters that can be entered in a text box. Set the enterkeytype attribute to control the text displayed on the Enter key on the soft keyboard.
  • Added the enterkeyclick parameter to the change event to set the Enter key tap event on the soft keyboard.

For details, please refer to input.

<text>

Added the support for the active pseudo-class.

<progress>

Added the support for the active pseudo-class.

<rating>

Added the support for the active pseudo-class.

<picker>

  • Added the support for the active pseudo-class.
  • Added the support for multi-column pickers.

For details, please refer to picker.

<slider>

Added the support for the active pseudo-class.

<switch>

Added the support for the active pseudo-class.

<textarea>

  • Added the support for the active pseudo-class.
  • Added the maxlength attribute and the support for the select, setSelectionRange, and getSelectionRange methods.
  • Added the function of allowing you to set the maxlength attribute to control the maximum number of characters that can be entered in a text box. Three new methods can be used to control the selected text box.

For details, please refer to textarea.

<list>

Added scrollState to the scroll event.

You can set scrollState to control the list scrolling status.

  • 0: The list is scrolling.
  • 1: A user is scrolling a list with gestures.
  • 2: A list is scrolling and a user already took fingers off the screen.

For details, please refer to list.

<swiper>

  • Added the loop attribute.
  • You can set the loop attribute to determine whether to enable the loop mode. The default value is true.

For details, please refer to swiper.

<video>

  • Added the controls attribute.
  • You can set the controls attribute to determine whether to display or hide the video playback control bar. The default value is true, indicating that the platform will determine whether to display the control bar. The value false indicates that the control bar is hidden.

For details, please refer to video.

[h2]APIs

Change Point

Description

General rules

An asynchronous API supports Promise, which enables asynchronous programming for higher readability and better control.

For details, please refer to Asynchronous API in General Rules.

file

Added the following APIs:

● file.writeText: writes text into a specified file.

● file.writeArrayBuffer: writes data into the buffer.

● file.readArrayBuffer: reads data from the buffer.

● file.readText: reads text.

For details, please refer to File Storage.

geolocation

Added the geolocation.getLocationType API to obtain the location type supported by the system.

For details, please refer to Location.

record

Added parameters to the record.start API to set the recording duration, recording format, sampling rate, number of recording channels, and bit rate.

For details, please refer to Recording.

request

Added the description and filename parameters to the request.download API for you to set the download description and name of the file to be downloaded.

For details, please refer to Upload and Download.

media

Added the following APIs:

● media.saveToPhotosAlbum: saves image or video files to an album.

● media.pickFile: selects a file.

For details, please refer to Multimedia.

sms

Added this API to implement the function of sending SMS messages.

For details, please refer to SMS Message Sending.

contact

Added this API to obtain the name and phone number of a contact.

For details, please refer to Contacts.

wifi

Added this API to query Wi-Fi information, connect to a Wi-Fi network, and monitor Wi-Fi connection status.

For details, please refer to Wi-Fi.