<aside> 🔌 The runtime API provides methods and events to manage the lifecycle of extensions, enabling operations like retrieving extension details, reloading, and handling updates or permissions changes.

</aside>

Functions


getManifest

ext.runtime.getManifest()

Retrieves the extension manifest

PARAMETERS

None.

RETURNS

Promise<any>

The extension manifest.


getPlatformInfo

ext.runtime.getPlatformInfo()

Retrieves platform information.

PARAMETERS

None.

RETURNS

Promise<PlatformInfo>

The promise resolves with platform information.


reload

ext.runtime.reload()

Performs an extension reload.

PARAMETERS

None.

RETURNS

Promise<void>

The promise resolves when reload is successful.


requestUpdateCheck

ext.runtime.requestUpdateCheck()

Checks for extension updates

PARAMETERS

None.

RETURNS

Promise<UpdateCheck>

The promise resolves with update information.


getModules

ext.runtime.getModules()

Retrieves currently loaded extension module.

PARAMETERS

None.

RETURNS

Promise<ModuleInfo[]>

The promise resolves with an array of modules loaded into the extension.


getPermissions

ext.runtime.getPermissions()

Retrieves granted permissions for all modules.

PARAMETERS

None.

RETURNS

Promise<{[module: string]: {[permission: string]: PermissionInfo}}>

The promise resolves with an object where the key is a module name and the value is an array of granted permissions.


sendMessage

ext.runtime.sendMessage(message: any)

Sends a message to all extension scripts including webviews owned by the extension.

PARAMETERS

message: any

Message to send.

RETURNS

Promise<void>

The promise resolves when the message is sent.


Types


PlatformInfo

Description: Represents the platform information.

os: string

The operating system. Can be one of mac, win, android, cros, linux, openbsd or fuchsia.

arch: string

The architecture of the operating system. Can be one of arm, arm64, x86-32, x86-64, mips or mips64.


UpdateCheck

Description: Represents the response to an update check.

status: 'no_update' | 'update_available'

The status of the update check.

details?: EventUpdate

The details of the update, if available.


ModuleInfo

Description: Represents module information.

name: string

Module name.

description: string

Module description.

version?: string

Requested module verison.

optional: boolean

True if module is optional.

loaded: boolean

True if module is loaded.


PermissionInfo

Description: Represents permission information.

description: string

Permission description.

optional: boolean

True if permission is optional.

revoked: boolean

True if permission is globally revoked.

granted: boolean

True if permission is granted.


EventUpdate

Description: Represents the details of an update event.

version: string

The version of the update.

version_name: string


EventPermission

Description: Represents the details of a permission event.

module: string

permission: string


EventModule

Description: Represents the state of a module.

id: string

path?: string


EventMessage

Description: Represents the state of a module.

extension: string


Events