WebKitWebInspector

WebKitWebInspector — Access to the WebKit Inspector

Synopsis

                    WebKitWebInspector;
const gchar *       webkit_web_inspector_get_inspected_uri
                                                        (WebKitWebInspector *web_inspector);
WebKitWebView *     webkit_web_inspector_get_web_view   (WebKitWebInspector *web_inspector);

Description

The WebKit Inspector is a graphical tool to inspect and change the content of a WebKitWebView. It also includes an interactive JavaScriptDebugger. 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 WebKitWebSettings of the WebKitWebView has set the "enable-developer-extras" to true otherwise no inspector is available.

/* Enable the developer extras */
WebKitWebSettings *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_open (WEBKIT_WEB_VIEW(my_webview), "http://www.gnome.org");

/* Embed the inspector somewhere */
WebKitWebInspector *inspector = webkit_web_view_get_inspector (WEBKIT_WEB_VIEW(my_webview));
g_signal_connect (G_OBJECT (inspector), "inspect-web-view", G_CALLBACK(create_gtk_window_around_it), NULL);
g_signal_connect (G_OBJECT (inspector), "show-window", G_CALLBACK(show_inpector_window), NULL));
g_signal_connect (G_OBJECT (inspector), "notify::inspected-uri", G_CALLBACK(inspected_uri_changed_do_stuff), NULL);

Details

WebKitWebInspector

typedef struct {
    GObject parent_instance;

    WebKitWebInspectorPrivate* priv;
} WebKitWebInspector;


webkit_web_inspector_get_inspected_uri ()

const gchar *       webkit_web_inspector_get_inspected_uri
                                                        (WebKitWebInspector *web_inspector);

Obtains the URI that is currently being inspected.

web_inspector :

Returns :

a pointer to the URI as an internally allocated string; it should not be freed, modified or stored.

Since 1.0.3


webkit_web_inspector_get_web_view ()

WebKitWebView *     webkit_web_inspector_get_web_view   (WebKitWebInspector *web_inspector);

Obtains the WebKitWebView that is used to render the inspector. The WebKitWebView instance is created by the application, by handling the "inspect-web-view" signal. This means that this method may return NULL if the user hasn't inspected anything.

web_inspector :

Returns :

the WebKitWebView instance that is used to render the inspector or NULL if it is not yet created.

Since 1.0.3