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 |
Defines how to handle cookies in a WebContext
.
The WebKitCookieManager defines how to set up and handle cookies.
You can get it from a WebsiteDataManager
with
webkit_website_data_manager_get_cookie_manager()
, and use it to set where to
store cookies with cookieManagerSetPersistentStorage
,
or to set the acceptance policy, with cookieManagerGetAcceptPolicy
.
Synopsis
- newtype CookieManager = CookieManager (ManagedPtr CookieManager)
- class (GObject o, IsDescendantOf CookieManager o) => IsCookieManager o
- toCookieManager :: (MonadIO m, IsCookieManager o) => o -> m CookieManager
- cookieManagerAddCookie :: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) => a -> Cookie -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- cookieManagerAddCookieFinish :: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) => a -> b -> m ()
- cookieManagerDeleteCookie :: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) => a -> Cookie -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- cookieManagerDeleteCookieFinish :: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) => a -> b -> m ()
- cookieManagerGetAcceptPolicy :: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- cookieManagerGetAcceptPolicyFinish :: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) => a -> b -> m CookieAcceptPolicy
- cookieManagerGetCookies :: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- cookieManagerGetCookiesFinish :: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) => a -> b -> m [Cookie]
- cookieManagerSetAcceptPolicy :: (HasCallStack, MonadIO m, IsCookieManager a) => a -> CookieAcceptPolicy -> m ()
- cookieManagerSetPersistentStorage :: (HasCallStack, MonadIO m, IsCookieManager a) => a -> Text -> CookiePersistentStorage -> m ()
- type CookieManagerChangedCallback = IO ()
- afterCookieManagerChanged :: (IsCookieManager a, MonadIO m) => a -> ((?self :: a) => CookieManagerChangedCallback) -> m SignalHandlerId
- onCookieManagerChanged :: (IsCookieManager a, MonadIO m) => a -> ((?self :: a) => CookieManagerChangedCallback) -> m SignalHandlerId
Exported types
newtype CookieManager Source #
Memory-managed wrapper type.
CookieManager (ManagedPtr CookieManager) |
Instances
Eq CookieManager Source # | |
Defined in GI.WebKit.Objects.CookieManager (==) :: CookieManager -> CookieManager -> Bool # (/=) :: CookieManager -> CookieManager -> Bool # | |
GObject CookieManager Source # | |
Defined in GI.WebKit.Objects.CookieManager | |
ManagedPtrNewtype CookieManager Source # | |
Defined in GI.WebKit.Objects.CookieManager toManagedPtr :: CookieManager -> ManagedPtr CookieManager | |
TypedObject CookieManager Source # | |
Defined in GI.WebKit.Objects.CookieManager | |
HasParentTypes CookieManager Source # | |
Defined in GI.WebKit.Objects.CookieManager | |
IsGValue (Maybe CookieManager) Source # | Convert |
Defined in GI.WebKit.Objects.CookieManager gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe CookieManager -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe CookieManager) | |
type ParentTypes CookieManager Source # | |
Defined in GI.WebKit.Objects.CookieManager type ParentTypes CookieManager = '[Object] |
class (GObject o, IsDescendantOf CookieManager o) => IsCookieManager o Source #
Type class for types which can be safely cast to CookieManager
, for instance with toCookieManager
.
Instances
(GObject o, IsDescendantOf CookieManager o) => IsCookieManager o Source # | |
Defined in GI.WebKit.Objects.CookieManager |
toCookieManager :: (MonadIO m, IsCookieManager o) => o -> m CookieManager Source #
Cast to CookieManager
, 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
addCookie, addCookieFinish, bindProperty, bindPropertyFull, deleteCookie, deleteCookieFinish, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAcceptPolicy, getAcceptPolicyFinish, getCookies, getCookiesFinish, getData, getProperty, getQdata.
Setters
setAcceptPolicy, setData, setDataFull, setPersistentStorage, setProperty.
addCookie
cookieManagerAddCookie Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) | |
=> a |
|
-> Cookie |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously add a Cookie
to the underlying storage.
When the operation is finished, callback
will be called. You can then call
cookieManagerAddCookieFinish
to get the result of the operation.
Since: 2.20
addCookieFinish
cookieManagerAddCookieFinish Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finish an asynchronous operation started with cookieManagerAddCookie
.
Since: 2.20
deleteCookie
cookieManagerDeleteCookie Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) | |
=> a |
|
-> Cookie |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously delete a Cookie
from the current session.
When the operation is finished, callback
will be called. You can then call
cookieManagerDeleteCookieFinish
to get the result of the operation.
Since: 2.20
deleteCookieFinish
cookieManagerDeleteCookieFinish Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finish an asynchronous operation started with cookieManagerDeleteCookie
.
Since: 2.20
getAcceptPolicy
cookieManagerGetAcceptPolicy Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously get the cookie acceptance policy of cookieManager
.
Note that when policy was set to CookieAcceptPolicyNoThirdParty
and
ITP is enabled, this will return CookieAcceptPolicyAlways
.
See also webkit_website_data_manager_set_itp_enabled()
.
When the operation is finished, callback
will be called. You can then call
cookieManagerGetAcceptPolicyFinish
to get the result of the operation.
getAcceptPolicyFinish
cookieManagerGetAcceptPolicyFinish Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m CookieAcceptPolicy | Returns: the cookie acceptance policy of |
Finish an asynchronous operation started with cookieManagerGetAcceptPolicy
.
getCookies
cookieManagerGetCookies Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously get a list of Cookie
from cookieManager
.
Asynchronously get a list of Cookie
from cookieManager
associated with uri
, which
must be either an HTTP or an HTTPS URL.
When the operation is finished, callback
will be called. You can then call
cookieManagerGetCookiesFinish
to get the result of the operation.
Since: 2.20
getCookiesFinish
cookieManagerGetCookiesFinish Source #
:: (HasCallStack, MonadIO m, IsCookieManager a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m [Cookie] |
Finish an asynchronous operation started with cookieManagerGetCookies
.
The return value is a SList
of Cookie
instances which should be released
with g_list_free_full()
and cookieFree
.
Since: 2.20
setAcceptPolicy
cookieManagerSetAcceptPolicy Source #
:: (HasCallStack, MonadIO m, IsCookieManager a) | |
=> a |
|
-> CookieAcceptPolicy |
|
-> m () |
Set the cookie acceptance policy of cookieManager
as policy
.
Note that ITP has its own way to handle third-party cookies, so when it's enabled,
and policy
is set to CookieAcceptPolicyNoThirdParty
, CookieAcceptPolicyAlways
will be used instead. Once disabled, the policy will be set back to CookieAcceptPolicyNoThirdParty
.
See also webkit_website_data_manager_set_itp_enabled()
.
setPersistentStorage
cookieManagerSetPersistentStorage Source #
:: (HasCallStack, MonadIO m, IsCookieManager a) | |
=> a |
|
-> Text |
|
-> CookiePersistentStorage |
|
-> m () |
Set non-session cookies.
Set the filename
where non-session cookies are stored persistently using
storage
as the format to read/write the cookies.
Cookies are initially read from filename
to create an initial set of cookies.
Then, non-session cookies will be written to filename
when the WebKitCookieManagerchanged
signal is emitted.
By default, cookieManager
doesn't store the cookies persistently, so you need to call this
method to keep cookies saved across sessions.
This method should never be called on a CookieManager
associated to an ephemeral WebsiteDataManager
.
Signals
changed
type CookieManagerChangedCallback = IO () Source #
This signal is emitted when cookies are added, removed or modified.
afterCookieManagerChanged :: (IsCookieManager a, MonadIO m) => a -> ((?self :: a) => CookieManagerChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
cookieManager #changed callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onCookieManagerChanged :: (IsCookieManager a, MonadIO m) => a -> ((?self :: a) => CookieManagerChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
cookieManager #changed callback