gi-webkit2-4.0.30: WebKit2 bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.WebKit2.Objects.WebInspector

Description

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

Exported types

newtype WebInspector Source #

Memory-managed wrapper type.

Constructors

WebInspector (ManagedPtr WebInspector) 

Instances

Instances details
Eq WebInspector Source # 
Instance details

Defined in GI.WebKit2.Objects.WebInspector

GObject WebInspector Source # 
Instance details

Defined in GI.WebKit2.Objects.WebInspector

ManagedPtrNewtype WebInspector Source # 
Instance details

Defined in GI.WebKit2.Objects.WebInspector

Methods

toManagedPtr :: WebInspector -> ManagedPtr WebInspector

TypedObject WebInspector Source # 
Instance details

Defined in GI.WebKit2.Objects.WebInspector

Methods

glibType :: IO GType

HasParentTypes WebInspector Source # 
Instance details

Defined in GI.WebKit2.Objects.WebInspector

IsGValue (Maybe WebInspector) Source #

Convert WebInspector to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.WebKit2.Objects.WebInspector

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe WebInspector -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe WebInspector)

type ParentTypes WebInspector Source # 
Instance details

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

Instances details
(GObject o, IsDescendantOf WebInspector o) => IsWebInspector o Source # 
Instance details

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

attach

webInspectorAttach Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> m () 

Request inspector to be attached.

The signal WebInspector::attach will be emitted. If the inspector is already attached it does nothing.

close

webInspectorClose Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> m () 

Request inspector to be closed.

detach

webInspectorDetach Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> m Bool

Returns: True if there is enough room for the inspector view inside the window that contains the inspected view, or False otherwise.

Whether the inspector can be attached to the same window that contains the inspected view.

Since: 2.8

getInspectedUri

webInspectorGetInspectedUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> m (Maybe Text)

Returns: the URI that is currently being inspected or Nothing

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 #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> m (Maybe WebViewBase)

Returns: the WebViewBase used to display the inspector or Nothing

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 #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> m Bool

Returns: True if inspector is currently attached or False otherwise

Whether the inspector view is currently attached to the same window that contains the inspected view.

show

webInspectorShow Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebInspector a) 
=> a

inspector: a WebInspector

-> 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 #

Arguments

 = IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

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 #

Arguments

 = IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

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 #

Arguments

 = IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

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 #

Arguments

 = IO Bool

Returns: True to stop other handlers from being invoked for the event. False to propagate the event further.

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