WebKit2.PolicyDecision

g GObject.Object GObject.Object WebKit2.PolicyDecision WebKit2.PolicyDecision GObject.Object->WebKit2.PolicyDecision

Subclasses:

WebKit2.NavigationPolicyDecision, WebKit2.ResponsePolicyDecision

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

download ()

ignore ()

use ()

use_with_policies (policies)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.PolicyDecision(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

WebKit2.PolicyDecisionClass

A pending policy decision.

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 WebKit2.WebView ::decide-policy signal with a WebKit2.PolicyDecision object. If the signal handler does nothing, WebKit will act as if WebKit2.PolicyDecision.use() was called as soon as signal handling completes. To make a policy decision asynchronously, simply increment the reference count of the WebKit2.PolicyDecision object.

download()

Spawn a download from this decision.

ignore()

WebKit2.ResponsePolicyDecision, this would cancel the request.

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

use()

Accept the action which triggered this decision.

use_with_policies(policies)
Parameters:

policies (WebKit2.WebsitePolicies) – a WebKit2.WebsitePolicies

Accept the navigation action and continue with provided 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.

New in version 2.30.