Megosztás a következőn keresztül:


WebViewPermissionRequest Class

Definition

Represents a request for permissions in a WebView.

public ref class WebViewPermissionRequest sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class WebViewPermissionRequest final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class WebViewPermissionRequest final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class WebViewPermissionRequest
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class WebViewPermissionRequest
Public NotInheritable Class WebViewPermissionRequest
Inheritance
Object Platform::Object IInspectable WebViewPermissionRequest
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

For more info, see the WebView.PermissionRequested event.

When you handle a permission request in a WebView, you get a WebViewPermissionRequest object as the value of the WebViewPermissionRequestedEventArgs.PermissionRequest property. You can call Allow to grant the request, Deny to deny the request, or Defer to defer the request until a later time. For example, you might defer the request if you need to prompt the user for consent.

Properties

Id

Gets the identifier for the permission request.

PermissionType

Gets a value that indicates the type of permission that's requested.

State

Gets the current state of the permission request.

Uri

Gets the Uniform Resource Identifier (URI) of the content where the permission request originated.

Methods

Allow()

Grants the requested permission.

Defer()

Defers the permission request to be allowed or denied at a later time.

Deny()

Denies the requested permission.

Applies to

See also