com.webos.service.webappmanager

Note
This API has been available since API level 11.

API Summary

Internal system service for handling web-based (HTML) applications.

The Web App Manager (WAM) is a component responsible for web application management in webOS platform. The Application Manager (SAM) sends a request to manage web applications to WAM.

WAM handles basic routines such as launching, closing apps as well as the following features of web applications.

  1. Running lists
  2. Life cycles
  3. Current status of applications
  4. Application crash

Overview of the API

NA

    Methods

    clearBrowsingData

    ACG: webapplication.management
    • Added: API level 11

    Description

    Clears the browsing data of a specific type.

    Parameters

    Name

    Required

    Type

    Description

    typesOptionalString array

    Indicates the type of the browsing data to be deleted.

    Possible values are:

    • all (includes browsing data of all other specified types)
    • appcache  (dropped since Chromium 85)
    • cache
    • codecache
    • cookies
    • fileSystems
    • localStorage
    • channelIDs
    • serviceWorkers
    • cacheStorage
    • webSQL

    Note: If no value is provided, by default, the method deletes all browsing data.

    Call Returns

    Name

    Required

    Type

    Description

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
    errorCodeOptionalNumber

    The error code for the failed operation.

    errorText OptionalString

    Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

    Error Codes Reference

    Error Code

    Error Text

    Error Description

    3000Empty array is not allowed.

    Occurs because value of array type for "types" parameter is not specified. It means that the array is defined but the length is 0.

    3001Invalid value (Only allowed for string type)

    Occurs because data type of "types" parameter is wrong. Only string array is possible. 

    3002Unknown data: [wrong value]

    Occurs because value of "types" parameter is unknown data. Refer to possible values specified in the parameter section.

    Example

    Example: Clear all browsing data

    - Using the "all" value for the "types" parameter

    # luna-send -n 1 luna://com.webos.service.webappmanager/clearBrowsingData '{"types":["all"]}'

    Response:
    {
        "returnValue": true  
    }

    - Without specifying the "types" parameter

    # luna-send -n 1 luna://com.webos.service.webappmanager/clearBrowsingData '{}'

    Response:
    {
        "returnValue": true  
    }

    Example: Clear specific browsing data

    - Clears localstorage type browsing data

    # luna-send -n 1 luna://com.webos.service.webappmanager/clearBrowsingData '{"types":["localStorage"]}'

    Response:
    {
        "returnValue": true  
    }

    - Clears localstorage and cache types of browsing data

    # luna-send -n 1 luna://com.webos.service.webappmanager/clearBrowsingData '{"types":["cache", "localStorage"]}'

    Response:
    {
        "returnValue": true  
    }

    closeAllApps

    ACG: webapplication.management
    • Added: API level 11

    Description

    Closes all the currently running applications.

    Parameters

    None

    Call Returns

    Name

    Required

    Type

    Description

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.

    Example

    Example code

    # luna-send -n 1 luna://com.webos.service.webappmanager/closeAllApps '{}'

    getWebProcessSize

    ACG: webapplication.management
    • Added: API level 11

    Description

    Gets the size of the current WebProcess.

    Parameters

    None

    Call Returns

    Name

    Required

    Type

    Description

    WebProcessesRequiredObject array: WebProcesses

    Indicates the list of apps which the process is running.

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.

    Example

    Example 2: With instanceId as a part of the returns

    # luna-send -n 1 luna://com.webos.service.webappmanager/getWebProcessSize '{}'

    Response:

    {
       "WebProcesses":[
          {
             "pid":"279",
             "runningApps":[
                {
                   "id":"com.webos.app.home",
                   "instanceId":"410e31c2-6b50-49e7-b63d-ba327fb94baf0"
                }
             ],
             "tileSize":0,
             "webProcessSize":"98024 kB"
          },
          {
             "pid":"306",
             "runningApps":[
                {
                   "id":"bareapp",
                   "instanceId":"668fef68-38fc-4b01-b681-0a06fe466bae0"
                }
             ],
             "tileSize":0,
             "webProcessSize":"77632 kB"
          }
       ],
       "returnValue":true
    }

    killApp

    ACG: webapplication.management
    • Added: API level 12

    Description

    Kills all the windows owned by the specified app.

    Note: The method is intended to be used by SAM if necessary.

    Parameters

    Name

    Required

    Type

    Description

    appIdRequiredString

    Indicates the ID of app to kill.

    instanceIdRequiredString

    Indicates the instance ID of the app to kill.

    Call Returns

    Name

    Required

    Type

    Description

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.
    errorCodeOptionalNumber

    The error code for the failed operation.

    errorTextOptionalString

    Indicates the reason for the failure of the operation. 

    appIdOptionalString

    Indicates the ID of the killed app.

    instanceIdOptionalString

    Indicates the instance ID of the killed app.

    Example

    Example code

    # luna-send -n 1 luna://com.webos.service.webappmanager/killApp '{
       "appId":"bareapp",
       "instanceId":"9a3b4236-3bf5-42bd-b32e-707211f716ac0"
    }'

    Response:

    {
        "appId": "bareapp",
        "instanceId": "9a3b4236-3bf5-42bd-b32e-707211f716ac0",
        "returnValue": true
    }

    launchApp

    ACG: webapplication.management
    • Added: API level 11

    Description

    Launches an application by the app ID.

    Note: This is the major function used by the SAM to request for launching an application.

    Parameters

    Name

    Required

    Type

    Description

    appDescRequiredString

    Indicates the JSON object containing the appinfo.json parameters determined by the SAM.

    parametersOptionalString

    Indicates the JSON object containing the parameters to pass to the app.

    launchingAppIdOptionalString

    Indicates the ID of the launching app.

    launchingProcIdOptionalNumber

    Indicates the ID of the process launching the app.

    instanceIdRequiredString

    Indicates the ID of the instance of the app which will be launched.

    Note: The instanceId is generated by the SAM for every new launch request.

    Call Returns

    Name

    Required

    Type

    Description

    appIdOptionalString

    Indicates the ID of the launched app.

    Note: The app is launched according to the properties specified in the appDesc parameter.

    procIdOptionalNumber

    Indicates the ID of the process assigned to the launch.

    errorCodeOptionalNumber

    The error code for the failed operation.

    errorTextOptionalString

    Indicates the reason for the failure of the operation.

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.
    instanceIdOptionalString

    Indicates the ID for the instance of the app that was launched.

    Example

    Example code

    # luna-send -n 1 luna://com.webos.service.webappmanager/launchApp '{
       "launchingAppId":"com.webos.app.home",
       "appDesc":{
          "defaultWindowType":"card",
          "uiRevision":"2",
          "systemApp":true,
          "version":"1.0.1",
          "vendor":"LG Electronics, Inc.",
          "miniicon":"icon.png",
          "hasPromotion":false,
          "tileSize":"normal",
          "icons":[
             
          ],
          "launchPointId":"bareapp_default",
          "largeIcon":"/usr/palm/applications/bareapp/icon.png",
          "lockable":true,
          "transparent":false,
          "icon":"/usr/palm/applications/bareapp/icon.png",
          "checkUpdateOnLaunch":true,
          "imageForRecents":"",
          "spinnerOnLaunch":true,
          "handlesRelaunch":false,
          "unmovable":false,
          "id":"bareapp",
          "inspectable":false,
          "noSplashOnLaunch":false,
          "privilegedJail":false,
          "trustLevel":"default",
          "title":"Bare App",
          "deeplinkingParams":"",
          "lptype":"default",
          "inAppSetting":false,
          "favicon":"",
          "visible":true,
          "accessibility":{
             "supportsAudioGuidance":false
          },
          "folderPath":"/usr/palm/applications/bareapp",
          "main":"index.html",
          "removable":true,
          "type":"web",
          "disableBackHistoryAPI":false,
          "bgImage":""
       },
       "appId":"bareapp",
       "parameters":{
          "displayAffinity":0
       },
       "reason":"com.webos.app.home",
       "launchingProcId":"",
       "instanceId":"188f99b7-1e1a-489f-8e3d-56844a7713030"
    }'

    Response:

    {
        "appId": "bareapp",
        "instanceId": "188f99b7-1e1a-489f-8e3d-56844a7713030",
        "returnValue": true
    }

    listRunningApps

    ACG: webapplication.management
    • Added: API level 12

    Description

    Returns the list of applications that the Web App Manager is running.

    Parameters

    Name

    Required

    Type

    Description

    subscribeOptionalBoolean

    Indicates if subscribed to get the notifications.

    Possible values are:

    • true: Subscribed for notifications
    • false: Not subscribed

    Default: false

    includeSysAppsOptionalBoolean

    Includes/excludes the system applications in the running app list.

    Possible values are:

    • true: Includes the system applications in the running app list.
    • false: Excludes the system applications from the running app list.

    Default: false

    Call Returns

    Name

    Required

    Type

    Description

    runningRequiredString array

    Indicates the array that contains the list of all running apps.

    Each app will be returned in the form of {"id": appId, "instanceId": instanceId, "webprocessid": weprocessid}.

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.

    Subscription Returns

    Name

    Required

    Type

    Description

    runningRequiredString array

    Indicates the array that contains the list of all running apps.

    Each app will be returned in the form of {"id": appId, "instanceId": instanceId, "webprocessid": weprocessid}.

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.
    subscribedRequiredBoolean

    Indicates if subscribed to get the notifications.

    Possible values are:

    • true: Subscribed for notifications
    • false: Not subscribed

    Example

    Example: Without parameters

    # luna-send -n 1 luna://com.webos.service.webappmanager/listRunningApps '{}'

    Response:

    {
       "returnValue":true,
       "running":[
          {
             "id":"com.webos.app.home",
             "instanceId":"410e31c2-6b50-49e7-b63d-ba327fb94baf0",
             "webprocessid":"279"
          },
          {
             "id":"bareapp",
             "instanceId":"668fef68-38fc-4b01-b681-0a06fe466bae0",
             "webprocessid":"306"
          }
       ]
    }

    logControl

    ACG: webapplication.management
    • Added: API level 11

    Description

    Enables or disables displaying the logs with associated keys.

    Parameters

    Name

    Required

    Type

    Description

    keysRequiredString

    Indicates the keys to determine which log to enable.

    Note: This parameter will be ignored if it doesn't match with existing keys.

    valueRequiredString

    Indicates if the log of the specified key is shown/hidden.

    Possible values are:

    • on: Shows log of the specified key
    • off: Hide log of the specified key

    Note: The value will be ignored when it is not "on" or "off".

    Call Returns

    Name

    Required

    Type

    Description

    eventOptionalBoolean

    Indicates whether event logs are shown or not.

    Possible values are:

    • true: If enabled to show event logs.
    • false: If disabled to show event logs.
    bundleMessageOptionalBoolean

    Indicates if the bundleMessage logs are shown or not.

    Possible values are:

    • true: If enabled showing bundleMessage logs.
    • false: If disabled showing bundleMessage logs.
    mouseMoveOptionalBoolean

    Indicates whether mouseMove logs are shown or not.

    • true: If enabled showing mouseMove logs.
    • false: If disabled showing mouseMove logs.
    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.

    Example

    Example code

    # luna-send -n 1 luna://com.webos.service.webappmanager/logControl '{
       "keys":"event",
       "value":"on"
    }'

    Response:

    {
       "bundleMessage":false,
       "event":true,
       "mouseMove":false,
       "returnValue":true
    }

    pauseApp

    ACG: webapplication.management
    • Added: API level 11

    Description

    Pauses the web application.

    Note: The method can be used by SAM to move a specified web application from foreground to background (currently, SAM uses the keep-alive feature instead of WAM).

    Parameters

    Name

    Required

    Type

    Description

    instanceIdRequiredString

    Indicates the instance ID of the app to be paused.

    Call Returns

    Name

    Required

    Type

    Description

    appIdOptionalString

    Indicates the ID of the app that is paused.

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
    errorCodeOptionalNumber

    The error code for the failed operation.

    errorTextOptionalString

    Indicates the reason for the failure of the operation.

    instanceIdOptionalString

    Indicates the instance ID of the app that is paused.

    Example

    Example: With instanceId

    # luna-send -n 1 -f luna://com.palm.webappmanager/pauseApp '{
       "instanceId":"7ca4b85d-43b2-4749-b2c3-346f6498c8590"
    }'

    Response:

    {
        "appId": "",
        "returnValue": true,
        "instanceId": "7ca4b85d-43b2-4749-b2c3-346f6498c8590"
    }

    webProcessCreated

    ACG: webapplication.management
    • Added: API level 12

    Description

    Returns the process ID of the launched application.

    Parameters

    Name

    Required

    Type

    Description

    appIdRequiredString

    Indicates the ID of the launched application.

    instanceIdRequiredString

    Indicates the instance ID of the launched application.

    subscribeOptionalBoolean

    Indicates if subscribed for notifications.

    Possible values are:

    • true: Subscribe for notifications
    • false: Not subscribed

    Default: false

    Call Returns

    Name

    Required

    Type

    Description

    idOptionalString

    Indicates the ID of the launched application.

    instanceIdOptionalString

    Indicates the instance ID of the launched application.

    errorTextOptionalString

    Indicates the reason for the failure of the operation.

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.
    webprocessidOptionalNumber

    Indicates the process ID of the launched application.

    Subscription Returns

    Name

    Required

    Type

    Description

    idOptionalString

    Indicates the ID of the launched application.

    instanceIdOptionalString

    Indicates the instance ID of the launched application

    returnValueRequiredBoolean

    Indicates the status of the operation.

    Possible values are:

    • true: Indicates that the operation was successful.
    • false: Indicates that the operation failed.
    subscribedOptionalBoolean

    Indicates if subscribed to get the notifications.

    Possible values are:

    • true - Subscribed for notifications
    • false - Not subscribed

    Example

    Example: With appId and instanceId

    # luna-send -n 1 luna://com.webos.service.webappmanager/webProcessCreated '{
       "instanceId":"de90e74a-b86b-42c8-8785-3efd927a36430",
       "appId":"bareapp"
    }'

    Response:

    {
        "id": "bareapp",
        "instanceId": "de90e74a-b86b-42c8-8785-3efd927a36430",
        "returnValue": true,
        "webprocessid": 197
    }

    Objects

    WebProcesses

    Contains the size of the current running WebProcess.

    Name

    Required

    Type

    Description

    pidOptionalString

    Indicates the ID of the process.

    webProcessSizeOptionalString

    Indicates the size of the process in KB.

    tileSizeOptionalNumber

    Indicates the size of the tile in KB.

    runningAppsOptionalString array

    Indicates the list of the apps which the process is running.

    API Error Codes Reference

    Error Code

    Error Text

    Error Description

    5000Incoming JSON is invalid or not completed

    Occurs because the parameter is wrong.

    Contents