Plugins
Generated from the plugin implementations. Follow the plugin tutorial to install a bundled plugin or connect page JavaScript to a host callback.
brimp.plugins
Explicit JavaScript plugins. Handlers run on a session's managed dispatcher.
Plugin
dataclass
Plugin(name: str, source: str, handlers: dict = dict(), options: dict = dict(), setup: object = None)
JavaScript installer plus synchronous host handlers and per-session setup.
The installer receives global, host and options. It may return a Promise and a disposer. Host handlers receive HostContext followed by copied values.
handlers
class-attribute
instance-attribute
handlers: dict = field(default_factory=dict)
name
instance-attribute
name: str
options
class-attribute
instance-attribute
options: dict = field(default_factory=dict)
setup
class-attribute
instance-attribute
setup: object = None
source
instance-attribute
source: str
from_file
classmethod
from_file(path, *, name, handlers=None, options=None, setup=None)
Source code in brimp/plugins.py
72 73 74 75 76 77 78 79 80 81 82 83 | |
HostContext
HostContext(inner)
Realm-bound notification sender; late results are discarded after cancellation.
Source code in brimp/plugins.py
19 20 | |
cancelled
property
cancelled
origin
property
origin
page_id
property
page_id
realm_id
property
realm_id
session_id
property
session_id
url
property
url
emit
emit(channel, value)
Source code in brimp/plugins.py
54 55 | |
function
function(name)
Source code in brimp/plugins.py
46 47 | |
catalog
catalog()
Return host-side capability/options metadata, without installing plugins.
Source code in brimp/plugins.py
225 226 227 228 229 | |
browser
browser()
Fresh default browser subsystem descriptors; excludes host storage and extraction.
Source code in brimp/plugins.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | |
host_storage
host_storage(*, backend_factory=_MemoryStorageBackend)
Explicit async hostStorage API, partitioned by native origin.
A backend provides synchronous transaction(origin, operations) and optional close(). It must atomically commit/rollback batches, including across sessions if the supplied backend shares durable state. The default is session memory.
Source code in brimp/plugins.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
extraction
extraction()
Explicit Defuddle article extraction using DOM-only heuristics.
Source code in brimp/plugins.py
185 186 187 | |
canvas
canvas(*, rgba=None, character_width=None)
Painted Canvas state with profile font metrics and a real PNG encoder.
Source code in brimp/plugins.py
140 141 142 143 144 145 146 147 | |
environment
environment(**options)
Explicit core navigator overrides; Configured connection values.
Source code in brimp/plugins.py
150 151 152 | |
permissions
permissions(**options)
Notification and permission mocks; Credential placeholders.
Source code in brimp/plugins.py
155 156 157 | |
devices
devices(**options)
Bluetooth availability; Clipboard, geolocation, wake lock and sharing placeholders.
Source code in brimp/plugins.py
160 161 162 | |
media
media(**options)
Media devices, streams and source-buffer placeholders; Media session state and encrypted-media event payloads.
Source code in brimp/plugins.py
165 166 167 | |
workers
workers(**options)
Worker and service-worker placeholders.
Source code in brimp/plugins.py
170 171 172 | |
trusted_types
trusted_types(**options)
Trusted Types placeholders.
Source code in brimp/plugins.py
175 176 177 | |
rtc
rtc()
Local WebRTC shapes and legacy placeholders; no network/media transport.
Source code in brimp/plugins.py
180 181 182 | |
graphics
graphics(*, rgba=None, renderer=None, webgpu=False, handlers=None)
WebGL state/readback with profile identity and opt-in WebGPU buffer mocks.
Source code in brimp/plugins.py
207 208 209 210 211 212 213 214 215 | |
audio
audio(*, sample_rate=None, handlers=None)
Audio graph/buffer state with profile rate; silent analysis, no decoding.
Source code in brimp/plugins.py
218 219 220 221 222 | |