class Qworum

Web pages can use the Qworum capabilities of web browsers through this JavaScript class.

These are the main methods that web pages use:

  • eval() evaluates a Qworum script.
  • setData() sets the value of a data container.
  • getData() reads the value of a data container.

Other methods:

  • checkAvailability() verifies that Qworum is available on the user's web browser.

All these methods are asynchronous.

Examples

Checking the browser's Qworum availability status.

try{ await Qworum.checkAvailability(); }catch(error){ console.error('Qworum browser extension not installed or not enabled.'); }

Fault raised.

await Qworum.eval( Script.build(Fault.build('payment cancelled')) );

Storing data in the current Qworum method call.

await Qworum.setData('year', Qworum.Json(2024));

Reading data stored in the current Qworum method call.

const result = await Qworum.getData(['year']); console.info(JSON.stringify(result.value));

Static Methods

Checks that:

  • the Qworum browser extension is installed and running, and
  • the website's origin is part of Qworum's Service Web.
eval(script)

Evaluates a Qworum script.

The outcome is one of:

  • Redirection to a new URL (the current Qworum session continues).
  • Closing of the browser tab after displaying an alert window (the current Qworum session has terminated).
getData(path)

Reads a value contained in a data container.

setData(
path,
value,
)

Sets the value contained in a data container.