Re: [dev] [surf] Bug: _SURF_URI and _SURF_GO sometimes won't update
This is a bug of surf, it usually happens when browsing some js heavy sites, I have something
like the following in my custom version of surf, and it solved the problem.
commit 9280cffc390e79416487d23f6cbca96fb80fc0da
Author: nzl <uruabi_AT_gmail.com>
Date: Fri Jan 18 06:44:30 2019 +0000
signal uri change
diff --git a/surf.c b/surf.c
index 5c8cb4e..fd7223c 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -175,6 +175,7 @@ static gboolean loadfailedtls(WebKitWebView *v, gchar *uri,
static void loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c);
static void progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c);
static void titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c);
+static void urichanged(WebKitWebView *view, GParamSpec *ps, Client *c);
static void mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h,
guint modifiers, Client *c);
static gboolean permissionrequested(WebKitWebView *v,
_AT_@ -531,6 +532,8 @@ newclient(void)
G_CALLBACK(progresschanged), c);
g_signal_connect(G_OBJECT(v), "notify::title",
G_CALLBACK(titlechanged), c);
+ g_signal_connect(G_OBJECT(v), "notify::uri",
+ G_CALLBACK(urichanged), c);
g_signal_connect(G_OBJECT(v), "button-release-event",
G_CALLBACK(buttonreleased), c);
g_signal_connect(G_OBJECT(v), "close",
_AT_@ -591,8 +594,6 @@ loaduri(Client *c, const char *uri)
free(apath);
}
- setatom(c, AtomUri, url);
-
if (strcmp(url, geturi(c)) == 0) {
a.i = 0;
reload(c, &a);
_AT_@ -600,9 +601,7 @@ loaduri(Client *c, const char *uri)
if (!useragent)
randuseragent(c);
webkit_web_view_load_uri(c->view, url);
- updatetitle(c);
}
-
g_free(url);
}
_AT_@ -1159,7 +1158,7 @@ loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c)
switch (e) {
case WEBKIT_LOAD_STARTED:
- setatom(c, AtomUri, uri);
+ c->overtitle = NULL;
c->title = uri;
c->https = c->insecure = 0;
seturiparameters(c, uri, loadtransient);
_AT_@ -1169,7 +1168,7 @@ loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c)
g_clear_object(&c->failedcert);
break;
case WEBKIT_LOAD_REDIRECTED:
- setatom(c, AtomUri, uri);
+ c->overtitle = NULL;
c->title = uri;
seturiparameters(c, uri, loadtransient);
break;
_AT_@ -1200,6 +1199,12 @@ titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c)
updatetitle(c);
}
+void
+urichanged(WebKitWebView *view, GParamSpec *ps, Client *c)
+{
+ setatom(c, AtomUri, geturi(c));
+}
+
void
mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, guint modifiers,
Client *c)
Received on Fri Mar 01 2019 - 13:09:39 CET
This archive was generated by hypermail 2.3.0
: Fri Mar 01 2019 - 13:12:09 CET