All Products
Search
Document Center

SuperApp:Other features

Last Updated:Jun 02, 2026

This topic describes additional JSAPI features for developing H5 apps and mini programs.

WindVaneReady event

WindVane fires the WindVaneReady event after a page finishes loading. Listen for this event to track page load status. The event also fires when a page is refreshed or when the user navigates back through the page history.

document.addEventListener('WindVaneReady', function(e) {
        alert('WindVaneReady');
}, false);

Background event

WindVane fires the WV.Event.APP.Background event when an app moves to the background — for example, when the user switches to another app or opens the notification bar. Listen for this event to detect when the app enters the background.

Platform behavior

  • [Android] The event also fires when the user switches from the current WebView to another Activity, not just when the app moves to the background.

  • [iOS v5.6.0 and later] The event also fires when the user switches from the current WebView to another native component or WebView, aligning with Android behavior.

Event parameters (iOS v5.6.0 and later)

The to parameter specifies where the user navigated from the current WebView:

  • 'background': The app moved to the background.

If to is absent, the destination cannot be determined.

Important

Background operations may be limited or delayed until the page is reactivated. Do not call alert() in this event handler — on some Android devices this causes a critical bug that renders all pages blank.

document.addEventListener('WV.Event.APP.Background', function(e) {
        // On some devices, calling alert() when the app enters the background causes issues.
        console.log('Event Background');
}, false);

Active event

WindVane fires the WV.Event.APP.Active event when an app returns to the foreground from the background. Listen for this event to detect when the app becomes active.

Platform behavior

  • [Android] The event also fires when the user switches from another Activity to the current WebView, not just when the app returns from the background.

  • [iOS v5.6.0 and later] The event also fires when the user switches from another native component or WebView to the current WebView, aligning with Android behavior.

Event parameters (iOS v5.6.0 and later)

The from parameter indicates where the user navigated from:

  • 'background': The app returned from the background.

  • 'webview': The user switched from another WebView.

If from is absent, the source cannot be determined.

WindVane v6.3.0 and later

A data parameter is available to retrieve data passed from WebAppInterface.pop.

document.addEventListener('WV.Event.APP.Active', function(e) {
        alert('Event Active');
}, false);