demo · v135

Custom command protocol

Beyond the built-in show-modal / toggle-popover set, the spec carved out custom commands using the -- prefix. Build a tiny audio-player remote where each control button dispatches a custom command (--play, --pause, --seek) and the target element listens via the command event. No addEventListener("click").

command/commandfor: ? custom commands: ?
track: paul kinlan — demo loop.mp3
statestopped
position0.0s
mutedno

command event log

see also