<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>
ext.runtime.getManifest()
Retrieves the extension manifest
PARAMETERS
None.
RETURNS
Promise<any>
The extension manifest.
ext.runtime.getPlatformInfo()
Retrieves platform information.
PARAMETERS
None.
RETURNS
Promise<PlatformInfo>
The promise resolves with platform information.
ext.runtime.reload()
Performs an extension reload.
PARAMETERS
None.
RETURNS
Promise<void>
The promise resolves when reload is successful.
ext.runtime.requestUpdateCheck()
Checks for extension updates
PARAMETERS
None.
RETURNS
Promise<UpdateCheck>
The promise resolves with update information.
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.
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.
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.
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
.
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.
Description: Represents module information.
name: string
description: string
version?: string
optional: boolean
loaded: boolean
Description: Represents permission information.