From: Daniel Carl <danielcarl@gmx.de>
Date: Sat, 6 Jul 2013 23:37:13 +0000 (+0200)
Subject: Revert "Inject hinting js and user scripts on window-object-cleared."
X-Git-Url: https://git.owens.tech/112-editable-focus.html/112-editable-focus.html/git?a=commitdiff_plain;h=d5f6f45c53f9e00da80fd346e0ea23677d250e58;p=vimb.git

Revert "Inject hinting js and user scripts on window-object-cleared."

This reverts commit ca1bee0a48beb81c123e8222dd0a6e8f36f6a622.

The VbHint object was not always available an we got a 'Reference error'.
---

diff --git a/src/main.c b/src/main.c
index efcfe64..8d29c01 100644
--- a/src/main.c
+++ b/src/main.c
@@ -63,8 +63,6 @@ static void download_progress_cp(WebKitDownload *download, GParamSpec *pspec);
 static void request_start_cb(WebKitWebView *webview, WebKitWebFrame *frame,
     WebKitWebResource *resource, WebKitNetworkRequest *request,
     WebKitNetworkResponse *response);
-static void window_object_cleared_cb(WebKitWebView *webview,
-    WebKitWebFrame *frame, JSContextRef context, JSObjectRef window, gpointer user_data);
 
 /* functions */
 static void run_user_script(WebKitWebFrame *frame);
@@ -434,6 +432,12 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec)
                 } else {
                     set_status(VB_STATUS_NORMAL);
                 }
+
+                /* inject the hinting javascript */
+                hints_init(frame);
+
+                /* run user script file */
+                run_user_script(frame);
             }
 
             if (vb.state.mode & VB_MODE_INSERT) {
@@ -782,7 +786,6 @@ static void setup_signals()
         "signal::download-requested", G_CALLBACK(vb_download), NULL,
         "signal::resource-request-starting", G_CALLBACK(request_start_cb), NULL,
         "signal::should-show-delete-interface-for-element", G_CALLBACK(gtk_false), NULL,
-        "signal::window-object-cleared", G_CALLBACK(window_object_cleared_cb), NULL,
         NULL
     );
 
@@ -1024,17 +1027,6 @@ static void download_progress_cp(WebKitDownload *download, GParamSpec *pspec)
     vb_update_statusbar();
 }
 
-static void window_object_cleared_cb(WebKitWebView *webview,
-    WebKitWebFrame *frame, JSContextRef context, JSObjectRef window, gpointer user_data)
-{
-
-    /* inject the hinting javascript */
-    hints_init(frame);
-
-    /* run user script file */
-    run_user_script(frame);
-}
-
 int main(int argc, char *argv[])
 {
     static char *winid = NULL;