summaryrefslogtreecommitdiffstats
path: root/src/web-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/web-view.c')
-rw-r--r--src/web-view.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/web-view.c b/src/web-view.c
index 01800b8..67e71cd 100644
--- a/src/web-view.c
+++ b/src/web-view.c
@@ -60,6 +60,13 @@ struct _MqWebViewClass {
G_DEFINE_TYPE(MqWebView, mq_web_view, WEBKIT_TYPE_WEB_VIEW)
+static void
+load_changed_cb(MqWebView *web_view, WebKitLoadEvent G_GNUC_UNUSED load_event)
+{
+ g_free(web_view->data);
+ web_view->data = NULL;
+}
+
static gboolean
context_menu_cb(MqWebView *web_view, WebKitContextMenu *context_menu,
GdkEvent *event, WebKitHitTestResult *hit_test_result)
@@ -325,6 +332,8 @@ mq_web_view_class_init(MqWebViewClass *klass)
static void
mq_web_view_init(MqWebView *web_view)
{
+ g_signal_connect(web_view, "load-changed",
+ G_CALLBACK(load_changed_cb), NULL);
g_signal_connect(web_view, "context-menu",
G_CALLBACK(context_menu_cb), NULL);
g_signal_connect(web_view, "notify::uri",