Skip to content

Events

This page documents various webview events


This event is emitted when a web-page requests a permission.

webview->on<saucer::webview::event::permission>([](const std::shared_ptr<saucer::permission::request>&) -> saucer::status {
// ...
});

The request holds the following information:

  • request->uri()

    The web-page that initiated this request

  • request->type()

    The type (saucer::permission::type) of the permission request. This can be one (or a combination) of the following:

    • unknown
    • audio_media
    • video_media
    • desktop_media
    • mouse_lock
    • device_info
    • location
    • clipboard
    • notification

Subscribers of this event can accept (request->accept(true)) or deny (request->accept(false)) this request. In case the request is ignored, it will be denied by default.