Hi! I added the command to open the web instector by :inspect so there is no need to use right mouse click to open it. Maybe this patch make no sense for the most users, but it introduces no big overhead, so I think it could be useful for others too.
Daniel
From 6e712e5cca09853cd47a5ada83962256c3576a8c Mon Sep 17 00:00:00 2001 From: Daniel Carl <[email protected]> Date: Thu, 6 Sep 2012 15:33:33 +0200 Subject: [PATCH] Added inspect command to open inspector. --- config.h | 1 + main.c | 22 ++++++++++++++++++++-- vimprobablerc.5 | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 45957c4..2874a67 100644 --- a/config.h +++ b/config.h @@ -142,6 +142,7 @@ Command commands[COMMANDSIZE] = { { "source", view_source, {0} }, { "set", browser_settings, {0} }, { "map", mappings, {0} }, + { "inspect", open_inspector, {0} }, { "jumpleft", scroll, {ScrollJumpTo | DirectionLeft} }, { "jumpright", scroll, {ScrollJumpTo | DirectionRight} }, { "jumptop", scroll, {ScrollJumpTo | DirectionTop} }, diff --git a/main.c b/main.c index b3407ba..72bace3 100644 --- a/main.c +++ b/main.c @@ -62,6 +62,7 @@ static gboolean descend(const Arg *arg); gboolean echo(const Arg *arg); static gboolean focus_input(const Arg *arg); static gboolean input(const Arg *arg); +static gboolean open_inspector(const Arg * arg); static gboolean navigate(const Arg *arg); static gboolean number(const Arg *arg); static gboolean open_arg(const Arg *arg); @@ -134,7 +135,7 @@ static char current_modkey; static char *search_handle; static gboolean search_direction; static gboolean echo_active = TRUE; -WebKitWebInspector *inspector; +static WebKitWebInspector *inspector; static GdkNativeWindow embed = 0; static char *configfile = NULL; @@ -1062,6 +1063,24 @@ echo(const Arg *arg) { return TRUE; } +static gboolean +open_inspector(const Arg * arg) { + gboolean inspect_enabled; + WebKitWebSettings *settings; + Arg a; + + settings = webkit_web_view_get_settings(webview); + g_object_get(G_OBJECT(settings), "enable-developer-extras", &inspect_enabled, NULL); + if (inspect_enabled) { + webkit_web_inspector_show(inspector); + } else { + a.i = Error; + a.s = g_strdup("Webinspector is not enabled"); + echo(&a); + g_free(a.s); + } +} + gboolean input(const Arg *arg) { int pos = 0; @@ -1684,7 +1703,6 @@ fake_key_event(const Arg *a) { return TRUE; } - gboolean commandhistoryfetch(const Arg *arg) { const int length = g_list_length(commandhistory); diff --git a/vimprobablerc.5 b/vimprobablerc.5 index f69dda9..5fcf02c 100644 --- a/vimprobablerc.5 +++ b/vimprobablerc.5 @@ -175,6 +175,9 @@ Save the current website in the bookmarks .IP source Toggle HTML source view +.IP inspect +Opens the webinspector if the webinspector is enabled + .IP jumpleft Scroll to left edge -- 1.7.9.5
signature.asc
Description: Digital signature
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Vimprobable-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/vimprobable-users
