Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
WebView::decidePolicy signal with a PolicyDecision
object. If the signal handler does nothing, WebKit will act as if
policyDecisionUse
was called as soon as signal handling
completes. To make a policy decision asynchronously, simply increment
the reference count of the PolicyDecision
object.
Synopsis
- newtype PolicyDecision = PolicyDecision (ManagedPtr PolicyDecision)
- class (GObject o, IsDescendantOf PolicyDecision o) => IsPolicyDecision o
- toPolicyDecision :: (MonadIO m, IsPolicyDecision o) => o -> m PolicyDecision
- policyDecisionDownload :: (HasCallStack, MonadIO m, IsPolicyDecision a) => a -> m ()
- policyDecisionIgnore :: (HasCallStack, MonadIO m, IsPolicyDecision a) => a -> m ()
- policyDecisionUse :: (HasCallStack, MonadIO m, IsPolicyDecision a) => a -> m ()
- policyDecisionUseWithPolicies :: (HasCallStack, MonadIO m, IsPolicyDecision a, IsWebsitePolicies b) => a -> b -> m ()
Exported types
newtype PolicyDecision Source #
Memory-managed wrapper type.
PolicyDecision (ManagedPtr PolicyDecision) |
Instances
Eq PolicyDecision Source # | |
Defined in GI.WebKit.Objects.PolicyDecision (==) :: PolicyDecision -> PolicyDecision -> Bool # (/=) :: PolicyDecision -> PolicyDecision -> Bool # | |
GObject PolicyDecision Source # | |
Defined in GI.WebKit.Objects.PolicyDecision | |
ManagedPtrNewtype PolicyDecision Source # | |
Defined in GI.WebKit.Objects.PolicyDecision toManagedPtr :: PolicyDecision -> ManagedPtr PolicyDecision | |
TypedObject PolicyDecision Source # | |
Defined in GI.WebKit.Objects.PolicyDecision | |
HasParentTypes PolicyDecision Source # | |
Defined in GI.WebKit.Objects.PolicyDecision | |
IsGValue (Maybe PolicyDecision) Source # | Convert |
Defined in GI.WebKit.Objects.PolicyDecision gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe PolicyDecision -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe PolicyDecision) | |
type ParentTypes PolicyDecision Source # | |
Defined in GI.WebKit.Objects.PolicyDecision type ParentTypes PolicyDecision = '[Object] |
class (GObject o, IsDescendantOf PolicyDecision o) => IsPolicyDecision o Source #
Type class for types which can be safely cast to PolicyDecision
, for instance with toPolicyDecision
.
Instances
(GObject o, IsDescendantOf PolicyDecision o) => IsPolicyDecision o Source # | |
Defined in GI.WebKit.Objects.PolicyDecision |
toPolicyDecision :: (MonadIO m, IsPolicyDecision o) => o -> m PolicyDecision Source #
Cast to PolicyDecision
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, download, forceFloating, freezeNotify, getv, ignore, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, use, useWithPolicies, watchClosure.
Getters
getData, getProperty, getQdata.
Setters
download
policyDecisionDownload Source #
:: (HasCallStack, MonadIO m, IsPolicyDecision a) | |
=> a |
|
-> m () |
Spawn a download from this decision.
ignore
:: (HasCallStack, MonadIO m, IsPolicyDecision a) | |
=> a |
|
-> m () |
ResponsePolicyDecision
, this would cancel the request.
Ignore the action which triggered this decision. For instance, for a
ResponsePolicyDecision
, this would cancel the request.
use
:: (HasCallStack, MonadIO m, IsPolicyDecision a) | |
=> a |
|
-> m () |
Accept the action which triggered this decision.
useWithPolicies
policyDecisionUseWithPolicies Source #
:: (HasCallStack, MonadIO m, IsPolicyDecision a, IsWebsitePolicies b) | |
=> a |
|
-> b |
|
-> m () |
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
.
Since: 2.30