| 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 |
GI.WebKit2.Structs.UserScript
Contents
Description
A JavaScript snippet which can be injected in loaded pages.
Since: 2.6
Synopsis
- newtype UserScript = UserScript (ManagedPtr UserScript)
- userScriptNew :: (HasCallStack, MonadIO m) => Text -> UserContentInjectedFrames -> UserScriptInjectionTime -> Maybe [Text] -> Maybe [Text] -> m UserScript
- userScriptNewForWorld :: (HasCallStack, MonadIO m) => Text -> UserContentInjectedFrames -> UserScriptInjectionTime -> Text -> Maybe [Text] -> Maybe [Text] -> m UserScript
- userScriptRef :: (HasCallStack, MonadIO m) => UserScript -> m UserScript
- userScriptUnref :: (HasCallStack, MonadIO m) => UserScript -> m ()
Exported types
newtype UserScript Source #
Memory-managed wrapper type.
Constructors
| UserScript (ManagedPtr UserScript) |
Instances
| Eq UserScript Source # | |
Defined in GI.WebKit2.Structs.UserScript | |
| GBoxed UserScript Source # | |
Defined in GI.WebKit2.Structs.UserScript | |
| ManagedPtrNewtype UserScript Source # | |
Defined in GI.WebKit2.Structs.UserScript Methods toManagedPtr :: UserScript -> ManagedPtr UserScript | |
| TypedObject UserScript Source # | |
Defined in GI.WebKit2.Structs.UserScript | |
| HasParentTypes UserScript Source # | |
Defined in GI.WebKit2.Structs.UserScript | |
| IsGValue (Maybe UserScript) Source # | Convert |
Defined in GI.WebKit2.Structs.UserScript Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe UserScript -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe UserScript) | |
| type ParentTypes UserScript Source # | |
Defined in GI.WebKit2.Structs.UserScript | |
Methods
Click to display all available methods, including inherited ones
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> UserContentInjectedFrames |
|
| -> UserScriptInjectionTime |
|
| -> Maybe [Text] |
|
| -> Maybe [Text] |
|
| -> m UserScript | Returns: A new |
Creates a new user script.
Scripts can be applied to some URIs
only by passing non-null values for allowList or blockList. Passing a
Nothing allow_list implies that all URIs are on the allow_list. The script
is applied if an URI matches the allow_list and not the block_list.
URI patterns must be of the form [protocol]://[host]/[path], where the
*host* and *path* components can contain the wildcard character (*) to
represent zero or more other characters.
Since: 2.6
newForWorld
userScriptNewForWorld Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> UserContentInjectedFrames |
|
| -> UserScriptInjectionTime |
|
| -> Text |
|
| -> Maybe [Text] |
|
| -> Maybe [Text] |
|
| -> m UserScript | Returns: A new |
Creates a new user script for script world with name worldName.
See userScriptNew for a full description.
Since: 2.22
ref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UserScript |
|
| -> m UserScript | Returns: The passed |
Atomically increments the reference count of userScript by one.
This function is MT-safe and may be called from any thread.
Since: 2.6
unref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => UserScript |
|
| -> m () |
Atomically decrements the reference count of userScript by one.
If the reference count drops to 0, all memory allocated by
UserScript is released. This function is MT-safe and may be called
from any thread.
Since: 2.6