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 |
Access to the WebKit inspector.
The WebKit Inspector is a graphical tool to inspect and change the
content of a WebView
. It also includes an interactive
JavaScript debugger. Using this class one can get a Widget
which can be embedded into an application to show the inspector.
The inspector is available when the Settings
of the
WebView
has set the Settings:enableDeveloperExtras
to true, otherwise no inspector is available.
c code
// Enable the developer extras WebKitSettings *settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW(my_webview)); g_object_set (G_OBJECT(settings), "enable-developer-extras", TRUE, NULL); // Load some data or reload to be able to inspect the page webkit_web_view_load_uri (WEBKIT_WEB_VIEW(my_webview), "http://www.gnome.org"); // Show the inspector WebKitWebInspector *inspector = webkit_web_view_get_inspector (WEBKIT_WEB_VIEW(my_webview)); webkit_web_inspector_show (WEBKIT_WEB_INSPECTOR(inspector));
Synopsis
- newtype WebInspector = WebInspector (ManagedPtr WebInspector)
- class (GObject o, IsDescendantOf WebInspector o) => IsWebInspector o
- toWebInspector :: (MonadIO m, IsWebInspector o) => o -> m WebInspector
- webInspectorAttach :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m ()
- webInspectorClose :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m ()
- webInspectorDetach :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m ()
- webInspectorGetAttachedHeight :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m Word32
- webInspectorGetCanAttach :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m Bool
- webInspectorGetInspectedUri :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m (Maybe Text)
- webInspectorGetWebView :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m (Maybe WebViewBase)
- webInspectorIsAttached :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m Bool
- webInspectorShow :: (HasCallStack, MonadIO m, IsWebInspector a) => a -> m ()
- getWebInspectorAttachedHeight :: (MonadIO m, IsWebInspector o) => o -> m Word32
- getWebInspectorCanAttach :: (MonadIO m, IsWebInspector o) => o -> m Bool
- getWebInspectorInspectedUri :: (MonadIO m, IsWebInspector o) => o -> m (Maybe Text)
- type WebInspectorAttachCallback = IO Bool
- afterWebInspectorAttach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorAttachCallback) -> m SignalHandlerId
- onWebInspectorAttach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorAttachCallback) -> m SignalHandlerId
- type WebInspectorBringToFrontCallback = IO Bool
- afterWebInspectorBringToFront :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorBringToFrontCallback) -> m SignalHandlerId
- onWebInspectorBringToFront :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorBringToFrontCallback) -> m SignalHandlerId
- type WebInspectorClosedCallback = IO ()
- afterWebInspectorClosed :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorClosedCallback) -> m SignalHandlerId
- onWebInspectorClosed :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorClosedCallback) -> m SignalHandlerId
- type WebInspectorDetachCallback = IO Bool
- afterWebInspectorDetach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorDetachCallback) -> m SignalHandlerId
- onWebInspectorDetach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorDetachCallback) -> m SignalHandlerId
- type WebInspectorOpenWindowCallback = IO Bool
- afterWebInspectorOpenWindow :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorOpenWindowCallback) -> m SignalHandlerId
- onWebInspectorOpenWindow :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorOpenWindowCallback) -> m SignalHandlerId
Exported types
newtype WebInspector Source #
Memory-managed wrapper type.
WebInspector (ManagedPtr WebInspector) |
Instances
Eq WebInspector Source # | |
Defined in GI.WebKit2.Objects.WebInspector (==) :: WebInspector -> WebInspector -> Bool # (/=) :: WebInspector -> WebInspector -> Bool # | |
GObject WebInspector Source # | |
Defined in GI.WebKit2.Objects.WebInspector | |
ManagedPtrNewtype WebInspector Source # | |
Defined in GI.WebKit2.Objects.WebInspector toManagedPtr :: WebInspector -> ManagedPtr WebInspector | |
TypedObject WebInspector Source # | |
Defined in GI.WebKit2.Objects.WebInspector | |
HasParentTypes WebInspector Source # | |
Defined in GI.WebKit2.Objects.WebInspector | |
IsGValue (Maybe WebInspector) Source # | Convert |
Defined in GI.WebKit2.Objects.WebInspector gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe WebInspector -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe WebInspector) | |
type ParentTypes WebInspector Source # | |
Defined in GI.WebKit2.Objects.WebInspector type ParentTypes WebInspector = '[Object] |
class (GObject o, IsDescendantOf WebInspector o) => IsWebInspector o Source #
Type class for types which can be safely cast to WebInspector
, for instance with toWebInspector
.
Instances
(GObject o, IsDescendantOf WebInspector o) => IsWebInspector o Source # | |
Defined in GI.WebKit2.Objects.WebInspector |
toWebInspector :: (MonadIO m, IsWebInspector o) => o -> m WebInspector Source #
Cast to WebInspector
, 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
attach, bindProperty, bindPropertyFull, close, detach, forceFloating, freezeNotify, getv, isAttached, isFloating, notify, notifyByPspec, ref, refSink, runDispose, show, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAttachedHeight, getCanAttach, getData, getInspectedUri, getProperty, getQdata, getWebView.
Setters
attach
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m () |
Request inspector
to be attached.
The signal WebInspector::attach will be emitted. If the inspector is already attached it does nothing.
close
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m () |
Request inspector
to be closed.
detach
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m () |
Request inspector
to be detached.
The signal WebInspector::detach will be emitted. If the inspector is already detached it does nothing.
getAttachedHeight
webInspectorGetAttachedHeight Source #
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m Word32 | Returns: the height of the inspector view when attached |
Get the height that the inspector view when attached.
Get the height that the inspector view should have when it's attached. If the inspector view is not attached this returns 0.
getCanAttach
webInspectorGetCanAttach Source #
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m Bool | Returns: |
Whether the inspector
can be attached to the same window that contains
the inspected view.
Since: 2.8
getInspectedUri
webInspectorGetInspectedUri Source #
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m (Maybe Text) | Returns: the URI that is currently being inspected or |
Get the URI that is currently being inspected.
This can be Nothing
if
nothing has been loaded yet in the inspected view, if the inspector
has been closed or when inspected view was loaded from a HTML string
instead of a URI.
getWebView
webInspectorGetWebView Source #
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m (Maybe WebViewBase) | Returns: the |
Get the WebViewBase
used to display the inspector.
This might be Nothing
if the inspector hasn't been loaded yet,
or it has been closed.
isAttached
webInspectorIsAttached Source #
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m Bool | Returns: |
Whether the inspector
view is currently attached to the same window that contains
the inspected view.
show
:: (HasCallStack, MonadIO m, IsWebInspector a) | |
=> a |
|
-> m () |
Request inspector
to be shown.
Properties
attachedHeight
The height that the inspector view should have when it is attached.
getWebInspectorAttachedHeight :: (MonadIO m, IsWebInspector o) => o -> m Word32 Source #
Get the value of the “attached-height
” property.
When overloading is enabled, this is equivalent to
get
webInspector #attachedHeight
canAttach
Whether the inspector
can be attached to the same window that contains
the inspected view.
Since: 2.8
getWebInspectorCanAttach :: (MonadIO m, IsWebInspector o) => o -> m Bool Source #
Get the value of the “can-attach
” property.
When overloading is enabled, this is equivalent to
get
webInspector #canAttach
inspectedUri
The URI that is currently being inspected.
getWebInspectorInspectedUri :: (MonadIO m, IsWebInspector o) => o -> m (Maybe Text) Source #
Get the value of the “inspected-uri
” property.
When overloading is enabled, this is equivalent to
get
webInspector #inspectedUri
Signals
attach
type WebInspectorAttachCallback Source #
= IO Bool | Returns: |
Emitted when the inspector is requested to be attached to the window where the inspected web view is. If this signal is not handled the inspector view will be automatically attached to the inspected view, so you only need to handle this signal if you want to attach the inspector view yourself (for example, to add the inspector view to a browser tab).
To prevent the inspector view from being attached you can connect to this
signal and simply return True
.
afterWebInspectorAttach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorAttachCallback) -> m SignalHandlerId Source #
Connect a signal handler for the attach signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webInspector #attach 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.
onWebInspectorAttach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorAttachCallback) -> m SignalHandlerId Source #
Connect a signal handler for the attach signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webInspector #attach callback
bringToFront
type WebInspectorBringToFrontCallback Source #
= IO Bool | Returns: |
Emitted when the inspector should be shown.
If the inspector is not attached the inspector window should be shown
on top of any other windows.
If the inspector is attached the inspector view should be made visible.
For example, if the inspector view is attached using a tab in a browser
window, the browser window should be raised and the tab containing the
inspector view should be the active one.
In both cases, if this signal is not handled, the default implementation
calls windowPresent
on the current toplevel Window
of the
inspector view.
afterWebInspectorBringToFront :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorBringToFrontCallback) -> m SignalHandlerId Source #
Connect a signal handler for the bringToFront signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webInspector #bringToFront 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.
onWebInspectorBringToFront :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorBringToFrontCallback) -> m SignalHandlerId Source #
Connect a signal handler for the bringToFront signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webInspector #bringToFront callback
closed
type WebInspectorClosedCallback = IO () Source #
Emitted when the inspector page is closed. If you are using your own inspector window, you should connect to this signal and destroy your window.
afterWebInspectorClosed :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorClosedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the closed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webInspector #closed 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.
onWebInspectorClosed :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorClosedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the closed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webInspector #closed callback
detach
type WebInspectorDetachCallback Source #
= IO Bool | Returns: |
Emitted when the inspector is requested to be detached from the window it is currently attached to. The inspector is detached when the inspector page is about to be closed, and this signal is emitted right before WebInspector::closed, or when the user clicks on the detach button in the inspector view to show the inspector in a separate window. In this case the signal WebInspector::openWindow is emitted after this one.
To prevent the inspector view from being detached you can connect to this
signal and simply return True
.
afterWebInspectorDetach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorDetachCallback) -> m SignalHandlerId Source #
Connect a signal handler for the detach signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webInspector #detach 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.
onWebInspectorDetach :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorDetachCallback) -> m SignalHandlerId Source #
Connect a signal handler for the detach signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webInspector #detach callback
openWindow
type WebInspectorOpenWindowCallback Source #
= IO Bool | Returns: |
Emitted when the inspector is requested to open in a separate window.
If this signal is not handled, a Window
with the inspector will be
created and shown, so you only need to handle this signal if you want
to use your own window.
This signal is emitted after WebInspector::detach to show
the inspector in a separate window after being detached.
To prevent the inspector from being shown you can connect to this
signal and simply return True
afterWebInspectorOpenWindow :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorOpenWindowCallback) -> m SignalHandlerId Source #
Connect a signal handler for the openWindow signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
webInspector #openWindow 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.
onWebInspectorOpenWindow :: (IsWebInspector a, MonadIO m) => a -> ((?self :: a) => WebInspectorOpenWindowCallback) -> m SignalHandlerId Source #
Connect a signal handler for the openWindow signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
webInspector #openWindow callback