Firefox (84+) supports this method by default, while on Chromium (73+) one needs to enable WebRTC PipeWire support by setting the corresponding (experimental) flag at the URL chrome://flags/#enable-webrtc-pipewire-capturer
.
This requires xdg-desktop-portal
and one of its backends to be installed. The available backends are:
xdg-desktop-portal-gnome
for GNOME.xdg-desktop-portal-kde
for KDE.xdg-desktop-portal-wlr
for wlroots-based Wayland compositors (e.g. Sway, dwl)