Cobalt Plugin

Version: 1.0

Status: :black_circle::black_circle::white_circle:

Cobalt plugin for Thunder framework.

Table of Contents

Introduction

Scope

This document describes purpose and functionality of the Cobalt plugin. It includes detailed specification of its configuration, methods and properties provided, as well as notifications sent.

Case Sensitivity

All identifiers on the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.

Acronyms, Abbreviations and Terms

The table below provides and overview of acronyms used in this document and their definitions.

AcronymDescription
APIApplication Programming Interface
HTTPHypertext Transfer Protocol
JSONJavaScript Object Notation; a data interchange format
JSON-RPCA remote procedure call protocol encoded in JSON

The table below provides and overview of terms and abbreviations used in this document and their definitions.

TermDescription
callsignThe name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique.

References

Ref IDDescription
HTTPHTTP specification
JSON-RPCJSON-RPC 2.0 specification
JSONJSON specification
ThunderThunder API Reference

Description

The Cobalt plugin provides web browsing functionality based on the Cobalt engine.

The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].

Configuration

The table below lists configuration options of the plugin.

NameTypeDescription
callsignstringPlugin instance name (default: Cobalt)
classnamestringClass name: Cobalt
locatorstringLibrary name: libWPEFrameworkCobalt.so
autostartbooleanDetermines if the plugin is to be started automatically along with the framework
configurationobject(optional)
configuration?.urlstring(optional) The URL that is loaded upon starting the browser
configuration?.languagestring(optional) POSIX-style Language(Locale) ID. Example: ‘en_US’

Methods

The following methods are provided by the Cobalt plugin:

Cobalt interface methods:

MethodDescription
deeplinkSend a deep link to the application

deeplink method

Send a deep link to the application.

Parameters

NameTypeDescription
paramsstringAn application-specific link

Result

NameTypeDescription
resultnull

Example

Request

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "method": "Cobalt.1.deeplink",
    "params": ""
}

Response

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "result": null
}

Properties

The following properties are provided by the Cobalt plugin:

StateControl interface properties:

PropertyDescription
stateRunning state of the service

state property

Provides access to the running state of the service.

Also see: statechange

Value

NameTypeDescription
(property)stringRunning state of the service (must be one of the following: resumed, suspended)

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "method": "Cobalt.1.state"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "result": "resumed"
}

Set Request

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "method": "Cobalt.1.state",
    "params": "resumed"
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 1234567890,
    "result": "null"
}

Notifications

Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.

The following events are provided by the Cobalt plugin:

StateControl interface events:

EventDescription
statechangeSignals a state change of the service

statechange event

Signals a state change of the service.

Parameters

NameTypeDescription
paramsobject
params.suspendedbooleanDetermines if the service has entered suspended state (true) or resumed state (false)

Example

{
    "jsonrpc": "2.0",
    "method": "client.events.1.statechange",
    "params": {
        "suspended": false
    }
}