<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
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.
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.
Description: Represents the details of an update event.
version: string
The version of the update.
version_name: string
Description: Represents the details of a permission event.
module: string
permission: string
Description: Represents the state of a module.
id: string
path?: string
Description: Represents the state of a module.
extension: string