WebKitPolicyDecision

WebKitPolicyDecision — A pending policy decision

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── WebKitPolicyDecision
        ├── WebKitNavigationPolicyDecision
        ╰── WebKitResponsePolicyDecision

Description

Often WebKit allows the client to decide the policy for certain operations. For instance, a client may want to open a link in a new tab, block a navigation entirely, query the user or trigger a download instead of a navigation. In these cases WebKit will fire the “decide-policy” signal with a WebKitPolicyDecision object. If the signal handler does nothing, WebKit will act as if webkit_policy_decision_use() was called as soon as signal handling completes. To make a policy decision asynchronously, simply increment the reference count of the WebKitPolicyDecision object.

Functions

webkit_policy_decision_download ()

void
webkit_policy_decision_download (WebKitPolicyDecision *decision);

Spawn a download from this decision.

Parameters

decision

a WebKitPolicyDecision

 

webkit_policy_decision_ignore ()

void
webkit_policy_decision_ignore (WebKitPolicyDecision *decision);

Ignore the action which triggered this decision. For instance, for a WebKitResponsePolicyDecision, this would cancel the request.

Parameters

decision

a WebKitPolicyDecision

 

webkit_policy_decision_use ()

void
webkit_policy_decision_use (WebKitPolicyDecision *decision);

Accept the action which triggered this decision.

Parameters

decision

a WebKitPolicyDecision

 

webkit_policy_decision_use_with_policies ()

void
webkit_policy_decision_use_with_policies
                               (WebKitPolicyDecision *decision,
                                WebKitWebsitePolicies *policies);

Accept the navigation action which triggered this decision, and continue with policies affecting all subsequent loads of resources in the origin associated with the accepted navigation action.

For example, a navigation decision to a video sharing website may be accepted under the priviso no movies are allowed to autoplay. The autoplay policy in this case would be set in the policies .

Parameters

decision

a WebKitPolicyDecision

 

policies

a WebKitWebsitePolicies

 

Since: 2.30

Types and Values

struct WebKitPolicyDecision

struct WebKitPolicyDecision;

See Also

WebKitWebView