Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
No description available in the introspection data.
Synopsis
- newtype UserContentManager = UserContentManager (ManagedPtr UserContentManager)
- class (GObject o, IsDescendantOf UserContentManager o) => IsUserContentManager o
- toUserContentManager :: (MonadIO m, IsUserContentManager o) => o -> m UserContentManager
- noUserContentManager :: Maybe UserContentManager
- userContentManagerAddFilter :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> UserContentFilter -> m ()
- userContentManagerAddScript :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> UserScript -> m ()
- userContentManagerAddStyleSheet :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> UserStyleSheet -> m ()
- userContentManagerNew :: (HasCallStack, MonadIO m) => m UserContentManager
- userContentManagerRegisterScriptMessageHandler :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> Text -> m Bool
- userContentManagerRegisterScriptMessageHandlerInWorld :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> Text -> Text -> m Bool
- userContentManagerRemoveAllFilters :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> m ()
- userContentManagerRemoveAllScripts :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> m ()
- userContentManagerRemoveAllStyleSheets :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> m ()
- userContentManagerRemoveFilter :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> UserContentFilter -> m ()
- userContentManagerUnregisterScriptMessageHandler :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> Text -> m ()
- userContentManagerUnregisterScriptMessageHandlerInWorld :: (HasCallStack, MonadIO m, IsUserContentManager a) => a -> Text -> Text -> m ()
- type C_UserContentManagerScriptMessageReceivedCallback = Ptr () -> Ptr JavascriptResult -> Ptr () -> IO ()
- type UserContentManagerScriptMessageReceivedCallback = JavascriptResult -> IO ()
- afterUserContentManagerScriptMessageReceived :: (IsUserContentManager a, MonadIO m) => a -> UserContentManagerScriptMessageReceivedCallback -> m SignalHandlerId
- genClosure_UserContentManagerScriptMessageReceived :: MonadIO m => UserContentManagerScriptMessageReceivedCallback -> m (GClosure C_UserContentManagerScriptMessageReceivedCallback)
- mk_UserContentManagerScriptMessageReceivedCallback :: C_UserContentManagerScriptMessageReceivedCallback -> IO (FunPtr C_UserContentManagerScriptMessageReceivedCallback)
- noUserContentManagerScriptMessageReceivedCallback :: Maybe UserContentManagerScriptMessageReceivedCallback
- onUserContentManagerScriptMessageReceived :: (IsUserContentManager a, MonadIO m) => a -> UserContentManagerScriptMessageReceivedCallback -> m SignalHandlerId
- wrap_UserContentManagerScriptMessageReceivedCallback :: UserContentManagerScriptMessageReceivedCallback -> C_UserContentManagerScriptMessageReceivedCallback
Exported types
newtype UserContentManager Source #
Memory-managed wrapper type.
Instances
class (GObject o, IsDescendantOf UserContentManager o) => IsUserContentManager o Source #
Type class for types which can be safely cast to UserContentManager
, for instance with toUserContentManager
.
Instances
(GObject o, IsDescendantOf UserContentManager o) => IsUserContentManager o Source # | |
Defined in GI.WebKit2.Objects.UserContentManager |
toUserContentManager :: (MonadIO m, IsUserContentManager o) => o -> m UserContentManager Source #
Cast to UserContentManager
, for types for which this is known to be safe. For general casts, use castTo
.
noUserContentManager :: Maybe UserContentManager Source #
A convenience alias for Nothing
:: Maybe
UserContentManager
.
Methods
addFilter
userContentManagerAddFilter Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> UserContentFilter |
|
-> m () |
Adds a UserContentFilter
to the given UserContentManager
.
The same UserContentFilter
can be reused with multiple
UserContentManager
instances.
Filters need to be saved and loaded from UserContentFilterStore
.
Since: 2.24
addScript
userContentManagerAddScript Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> UserScript |
|
-> m () |
Adds a UserScript
to the given UserContentManager
.
The same UserScript
can be reused with multiple
UserContentManager
instances.
Since: 2.6
addStyleSheet
userContentManagerAddStyleSheet Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> UserStyleSheet |
|
-> m () |
Adds a UserStyleSheet
to the given UserContentManager
.
The same UserStyleSheet
can be reused with multiple
UserContentManager
instances.
Since: 2.6
new
userContentManagerNew Source #
:: (HasCallStack, MonadIO m) | |
=> m UserContentManager | Returns: A |
Creates a new user content manager.
Since: 2.6
registerScriptMessageHandler
userContentManagerRegisterScriptMessageHandler Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
Registers a new user script message handler. After it is registered,
scripts can use window.webkit.messageHandlers.<name>.postMessage(value)
to send messages. Those messages are received by connecting handlers
to the UserContentManager
::script-message-received
signal. The
handler name is used as the detail of the signal. To avoid race
conditions between registering the handler name, and starting to
receive the signals, it is recommended to connect to the signal
*before* registering the handler name:
<informalexample><programlisting> WebKitWebView *view = webkit_web_view_new (); WebKitUserContentManager *manager = webkit_web_view_get_user_content_manager (); g_signal_connect (manager, "script-message-received::foobar", G_CALLBACK (handle_script_message), NULL); webkit_user_content_manager_register_script_message_handler (manager, "foobar"); </programlisting></informalexample>
Registering a script message handler will fail if the requested name has been already registered before.
Since: 2.8
registerScriptMessageHandlerInWorld
userContentManagerRegisterScriptMessageHandlerInWorld Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m Bool | Returns: |
Registers a new user script message handler in script world with name worldName
.
See userContentManagerRegisterScriptMessageHandler
for full description.
Registering a script message handler will fail if the requested name has been already registered before.
Since: 2.22
removeAllFilters
userContentManagerRemoveAllFilters Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> m () |
Removes all content filters from the given UserContentManager
.
Since: 2.24
removeAllScripts
userContentManagerRemoveAllScripts Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> m () |
Removes all user scripts from the given UserContentManager
Since: 2.6
removeAllStyleSheets
userContentManagerRemoveAllStyleSheets Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> m () |
Removes all user style sheets from the given UserContentManager
.
Since: 2.6
removeFilter
userContentManagerRemoveFilter Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> UserContentFilter |
|
-> m () |
Removes a filter from the given UserContentManager
.
Since 2.24
unregisterScriptMessageHandler
userContentManagerUnregisterScriptMessageHandler Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> Text |
|
-> m () |
Unregisters a previously registered message handler.
Note that this does *not* disconnect handlers for the
UserContentManager
::script-message-received
signal;
they will be kept connected, but the signal will not be emitted
unless the handler name is registered again.
See also userContentManagerRegisterScriptMessageHandler
.
Since: 2.8
unregisterScriptMessageHandlerInWorld
userContentManagerUnregisterScriptMessageHandlerInWorld Source #
:: (HasCallStack, MonadIO m, IsUserContentManager a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
Unregisters a previously registered message handler in script world with name worldName
.
Note that this does *not* disconnect handlers for the
UserContentManager
::script-message-received
signal;
they will be kept connected, but the signal will not be emitted
unless the handler name is registered again.
See also userContentManagerRegisterScriptMessageHandlerInWorld
.
Since: 2.22
Signals
scriptMessageReceived
type C_UserContentManagerScriptMessageReceivedCallback = Ptr () -> Ptr JavascriptResult -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type UserContentManagerScriptMessageReceivedCallback Source #
= JavascriptResult |
|
-> IO () |
This signal is emitted when JavaScript in a web view calls
<code>window.webkit.messageHandlers.<name>.postMessage()
</code>, after registering
<code><name></code> using
userContentManagerRegisterScriptMessageHandler
Since: 2.8
afterUserContentManagerScriptMessageReceived :: (IsUserContentManager a, MonadIO m) => a -> UserContentManagerScriptMessageReceivedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “script-message-received
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
userContentManager #scriptMessageReceived callback
genClosure_UserContentManagerScriptMessageReceived :: MonadIO m => UserContentManagerScriptMessageReceivedCallback -> m (GClosure C_UserContentManagerScriptMessageReceivedCallback) Source #
Wrap the callback into a GClosure
.
mk_UserContentManagerScriptMessageReceivedCallback :: C_UserContentManagerScriptMessageReceivedCallback -> IO (FunPtr C_UserContentManagerScriptMessageReceivedCallback) Source #
Generate a function pointer callable from C code, from a C_UserContentManagerScriptMessageReceivedCallback
.
noUserContentManagerScriptMessageReceivedCallback :: Maybe UserContentManagerScriptMessageReceivedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
UserContentManagerScriptMessageReceivedCallback
onUserContentManagerScriptMessageReceived :: (IsUserContentManager a, MonadIO m) => a -> UserContentManagerScriptMessageReceivedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “script-message-received
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
userContentManager #scriptMessageReceived callback