diff -upr webkitgtk-2.4.8.orig/Source/WebCore/bindings/gobject/DOMObjectCache.cpp webkitgtk-2.4.8/Source/WebCore/bindings/gobject/DOMObjectCache.cpp
--- webkitgtk-2.4.8.orig/Source/WebCore/bindings/gobject/DOMObjectCache.cpp	2015-02-18 16:56:13.696045964 +0100
+++ webkitgtk-2.4.8/Source/WebCore/bindings/gobject/DOMObjectCache.cpp	2015-02-23 11:21:15.065452885 +0100
@@ -24,6 +24,11 @@
 #include <glib-object.h>
 #include <wtf/HashMap.h>
 
+extern "C" {
+GFunc dom_object_cache_pointer_added = NULL;
+GFunc dom_object_cache_pointer_removed = NULL;
+}
+
 namespace WebKit {
 
 typedef struct {
@@ -51,9 +56,13 @@ static WebCore::Frame* getFrameFromHandl
 void DOMObjectCache::forget(void* objectHandle)
 {
     DOMObjectCacheData* cacheData = domObjects().get(objectHandle);
+	gpointer frame = cacheData->frame;
     ASSERT(cacheData);
     g_slice_free(DOMObjectCacheData, cacheData);
     domObjects().take(objectHandle);
+
+	if (dom_object_cache_pointer_removed)
+		dom_object_cache_pointer_removed (objectHandle, frame);
 }
 
 static void weakRefNotify(gpointer data, GObject* zombie)
@@ -140,6 +149,8 @@ void* DOMObjectCache::put(void* objectHa
     data->timesReturned = 1;
 
     domObjects().set(objectHandle, data);
+    if (dom_object_cache_pointer_added)
+	    dom_object_cache_pointer_added (objectHandle, NULL);
     return wrapper;
 }
 
@@ -147,14 +158,38 @@ void* DOMObjectCache::put(WebCore::Node*
 {
     // call the ::put version that takes void* to do the basic cache
     // insertion work
-    put(static_cast<void*>(objectHandle), wrapper);
+    if (!domObjects().get(objectHandle)) {
+	    DOMObjectCacheData* data = g_slice_new(DOMObjectCacheData);
+	    data->object = static_cast<GObject*>(wrapper);
+	    data->frame = 0;
+	    data->timesReturned = 1;
+
+	    domObjects().set(objectHandle, data);
+    }
 
     DOMObjectCacheData* data = domObjects().get(objectHandle);
     ASSERT(data);
 
     data->frame = getFrameFromHandle(objectHandle);
+    if (dom_object_cache_pointer_added)
+	    dom_object_cache_pointer_added (objectHandle, data->frame);
 
     return wrapper;
 }
 
 }
+
+void dom_object_dump_pointers (void)
+{
+	using namespace WebKit;
+
+	printf ("%s: objects:%d\n", __FUNCTION__, domObjects().size());
+
+	DOMObjectMap::iterator end = domObjects().end();
+	for (DOMObjectMap::iterator iter = domObjects().begin(); iter != end; ++iter) {
+		DOMObjectCacheData* data = iter->value;
+		ASSERT(data);
+
+		printf ("\t%p: refs:%d %s\n", data->object, data->object ? data->object->ref_count : -1, data->object ? G_OBJECT_TYPE_NAME (data->object) : "???");
+	}
+}
diff -upr webkitgtk-2.4.8.orig/Source/WebCore/bindings/gobject/DOMObjectCache.h webkitgtk-2.4.8/Source/WebCore/bindings/gobject/DOMObjectCache.h
--- webkitgtk-2.4.8.orig/Source/WebCore/bindings/gobject/DOMObjectCache.h	2015-02-18 16:56:13.688045965 +0100
+++ webkitgtk-2.4.8/Source/WebCore/bindings/gobject/DOMObjectCache.h	2015-02-23 11:20:51.945453880 +0100
@@ -19,6 +19,14 @@
 #ifndef DOMObjectCache_h
 #define DOMObjectCache_h
 
+#include <glib.h>
+
+extern "C" {
+extern GFunc dom_object_cache_pointer_added;
+extern GFunc dom_object_cache_pointer_removed;
+void dom_object_dump_pointers (void);
+}
+
 namespace WebCore {
 class Node;
 class Frame;
diff -upr webkitgtk-2.4.8.orig/Source/WebKit/gtk/docs/webkitgtk-sections.txt webkitgtk-2.4.8/Source/WebKit/gtk/docs/webkitgtk-sections.txt
--- webkitgtk-2.4.8.orig/Source/WebKit/gtk/docs/webkitgtk-sections.txt	2015-02-18 16:56:08.667046177 +0100
+++ webkitgtk-2.4.8/Source/WebKit/gtk/docs/webkitgtk-sections.txt	2015-02-23 12:32:32.293268705 +0100
@@ -477,6 +477,8 @@ webkit_web_view_zoom_in
 webkit_web_view_zoom_out
 webkit_web_view_get_window_features
 webkit_web_view_get_snapshot
+webkit_web_view_dom_object_cache_set_pointer_callabacks
+webkit_web_view_dom_object_cache_dump_pointers
 <SUBSECTION Standard>
 WEBKIT_WEB_VIEW
 WEBKIT_IS_WEB_VIEW
diff -upr webkitgtk-2.4.8.orig/Source/WebKit/gtk/webkit/webkitwebview.cpp webkitgtk-2.4.8/Source/WebKit/gtk/webkit/webkitwebview.cpp
--- webkitgtk-2.4.8.orig/Source/WebKit/gtk/webkit/webkitwebview.cpp	2015-02-18 16:56:08.556046182 +0100
+++ webkitgtk-2.4.8/Source/WebKit/gtk/webkit/webkitwebview.cpp	2015-02-23 12:31:18.729271873 +0100
@@ -48,6 +48,7 @@
 #include "DatabaseManager.h"
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "DOMObjectCache.h"
 #include "DragActions.h"
 #include "DragClientGtk.h"
 #include "DragController.h"
@@ -5579,3 +5580,15 @@ WebKitWebView* kit(WebCore::Page* corePa
 }
 
 }
+
+void webkit_web_view_dom_object_cache_dump_pointers(void)
+{
+	dom_object_dump_pointers ();
+}
+
+void webkit_web_view_dom_object_cache_set_pointer_callabacks (GFunc pointer_added,
+							      GFunc pointer_removed)
+{
+	dom_object_cache_pointer_added = pointer_added;
+	dom_object_cache_pointer_removed = pointer_removed;
+}
diff -upr webkitgtk-2.4.8.orig/Source/WebKit/gtk/webkit/webkitwebview.h webkitgtk-2.4.8/Source/WebKit/gtk/webkit/webkitwebview.h
--- webkitgtk-2.4.8.orig/Source/WebKit/gtk/webkit/webkitwebview.h	2015-02-18 16:56:08.618046179 +0100
+++ webkitgtk-2.4.8/Source/WebKit/gtk/webkit/webkitwebview.h	2015-02-23 12:31:36.826271094 +0100
@@ -448,6 +448,10 @@ webkit_web_view_get_viewport_attributes
 WEBKIT_API cairo_surface_t*
 webkit_web_view_get_snapshot                    (WebKitWebView        *web_view);
 
+WEBKIT_API void webkit_web_view_dom_object_cache_set_pointer_callabacks (GFunc pointer_added,
+									 GFunc pointer_removed);
+WEBKIT_API void webkit_web_view_dom_object_cache_dump_pointers (void);
+
 G_END_DECLS
 
 #endif
