X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=surf.c;h=448c762604048312b2cab950dc5a2091c348562d;hb=e9c9715f52afd3b4e3d512aea9d021e7e1980f63;hp=0ed831c22a665e35cc3d6ecdee8b5fb0b83f1eca;hpb=a7f2765da47529142d61c369f0cea6a68db4ed20;p=surf.git diff --git a/surf.c b/surf.c index 0ed831c..448c762 100644 --- a/surf.c +++ b/surf.c @@ -254,7 +254,7 @@ void download(Client *c, const Arg *arg) { char *uri; WebKitNetworkRequest *r; - WebKitDownload *dl; + WebKitDownload *dl; if(arg->v) uri = (char *)arg->v; @@ -420,18 +420,17 @@ linkhover(WebKitWebView *v, const char* t, const char* l, Client *c) { void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) { - if(c->download) - stop(c, NULL); switch(webkit_web_view_get_load_status (c->view)) { case WEBKIT_LOAD_COMMITTED: - setatom(c, uriprop, geturi(c)); + if(c->download) + stop(c, NULL); + setatom(c, uriprop, geturi(c)); break; case WEBKIT_LOAD_FINISHED: c->progress = 0; update(c); break; - case WEBKIT_LOAD_PROVISIONAL: - case WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT: + default: break; } } @@ -589,9 +588,8 @@ newrequest(SoupSession *s, SoupMessage *msg, gpointer v) { soup_message_headers_remove(h, "Cookie"); uri = soup_message_get_uri(msg); - if((c = getcookies(uri))) { + if((c = getcookies(uri))) soup_message_headers_append(h, "Cookie", c); - } g_signal_connect_after(G_OBJECT(msg), "got-headers", G_CALLBACK(gotheaders), NULL); } @@ -613,7 +611,7 @@ newwindow(Client *c, const Arg *arg) { if(!plugin) cmd[i++] = "-p"; if(!loadimage) - cmd[i++] = "-l"; + cmd[i++] = "-i"; if(showxid) cmd[i++] = "-x"; cmd[i++] = "--"; @@ -707,7 +705,7 @@ setcookie(SoupCookie *c) { SoupDate *e; SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, FALSE); c = soup_cookie_copy(c); - if(c && c->expires == NULL) { + if(c->expires == NULL) { e = soup_date_new_from_time_t(time(NULL) + sessiontime); soup_cookie_set_expires(c, e); } @@ -754,7 +752,6 @@ setup(void) { soup_session_remove_feature_by_type(s, soup_cookie_jar_get_type()); g_signal_connect_after(G_OBJECT(s), "request-started", G_CALLBACK(newrequest), NULL); - /* proxy */ if((proxy = getenv("http_proxy")) && strcmp(proxy, "")) { new_proxy = g_strrstr(proxy, "http://") ? g_strdup(proxy) :