WebInspector

The WebKit Inspector is a graphical tool to inspect and change the content of a #WebKitWebView. It also includes an interactive JavaScript debugger. Using this class one can get a #GtkWidget which can be embedded into an application to show the inspector.

The inspector is available when the #WebKitSettings of the #WebKitWebView has set the #WebKitSettings:enable-developer-extras to true, otherwise no inspector is available.

<informalexample><programlisting> /<!-- -->* Enable the developer extras *<!-- -->/ WebKitSettings *setting = 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)); </programlisting></informalexample>

Constructors

this
this(WebKitWebInspector* webKitWebInspector, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

addOnAttach
gulong addOnAttach(bool delegate(WebInspector) dlg, ConnectFlags connectFlags)

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).

addOnBringToFront
gulong addOnBringToFront(bool delegate(WebInspector) dlg, ConnectFlags connectFlags)

Emitted when the inspector should be shown.

addOnClosed
gulong addOnClosed(void delegate(WebInspector) dlg, ConnectFlags connectFlags)

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.

addOnDetach
gulong addOnDetach(bool delegate(WebInspector) dlg, ConnectFlags connectFlags)

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 #WebKitWebInspector::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 #WebKitWebInspector::open-window is emitted after this one.

addOnOpenWindow
gulong addOnOpenWindow(bool delegate(WebInspector) dlg, ConnectFlags connectFlags)

Emitted when the inspector is requested to open in a separate window. If this signal is not handled, a #GtkWindow 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 #WebKitWebInspector::detach to show the inspector in a separate window after being detached.

attach
void attach()

Request @inspector to be attached. The signal #WebKitWebInspector::attach will be emitted. If the inspector is already attached it does nothing.

close
void close()

Request @inspector to be closed.

detach
void detach()

Request @inspector to be detached. The signal #WebKitWebInspector::detach will be emitted. If the inspector is already detached it does nothing.

getAttachedHeight
uint getAttachedHeight()

Get the height that the inspector view should have when it's attached. If the inspector view is not attached this returns 0.

getCanAttach
bool getCanAttach()

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

getInspectedUri
string getInspectedUri()

Get the URI that is currently being inspected. This can be %NULL 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.

getStruct
void* getStruct()

the main Gtk struct as a void*

getWebInspectorStruct
WebKitWebInspector* getWebInspectorStruct(bool transferOwnership)

Get the main Gtk struct

getWebView
WebViewBase getWebView()

Get the #WebKitWebViewBase used to display the inspector. This might be %NULL if the inspector hasn't been loaded yet, or it has been closed.

isAttached
bool isAttached()

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

show
void show()

Request @inspector to be shown.

Static functions

getType
GType getType()

Variables

webKitWebInspector
WebKitWebInspector* webKitWebInspector;

the main Gtk struct

Meta