Permissions

This guide shows how to grant or deny permissions for websites.

It is possible to handle the case when a web page requests a permission, for example, to enable geolocation or a Flash player. These permissions can be granted or denied by setting up a permission handler. See the code sample below:

// Grant all permissions
engine.Permissions.RequestPermissionHandler =
    new Handler<RequestPermissionParameters, RequestPermissionResponse>(p =>
    {
        return RequestPermissionResponse.Grant();
    });

You can also grant a specific permission only:

// Grant Geolocation permission
engine.Permissions.RequestPermissionHandler =
    new Handler<RequestPermissionParameters, RequestPermissionResponse>(p =>
    {
        if(p.Type == PermissionType.Geolocation)
        {
            return RequestPermissionResponse.Grant();
        }

        return RequestPermissionResponse.Deny();
    });
Go Top