WebKitWebInspector *inspector;
WebKitFindController *finder;
WebKitHitTestResult *mousepos;
- GTlsCertificateFlags tlsflags;
+ GTlsCertificateFlags tlserr;
Window xid;
- int progress, fullscreen;
+ int progress, fullscreen, https, insecure;
const char *title, *overtitle, *targeturi;
const char *needle;
struct Client *next;
static void decidenavigation(WebKitPolicyDecision *d, Client *c);
static void decidenewwindow(WebKitPolicyDecision *d, Client *c);
static void decideresource(WebKitPolicyDecision *d, Client *c);
+static void insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e,
+ Client *c);
static void downloadstarted(WebKitWebContext *wc, WebKitDownload *d,
Client *c);
static void responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c);
clients = c;
c->progress = 100;
- c->tlsflags = G_TLS_CERTIFICATE_VALIDATE_ALL + 1;
c->view = newview(c, rc ? rc->view : NULL);
return c;
void
getpagestats(Client *c)
{
- pagestats[0] = c->tlsflags > G_TLS_CERTIFICATE_VALIDATE_ALL ? '-' :
- c->tlsflags > 0 ? 'U' : 'T';
+ if (c->https)
+ pagestats[0] = (c->tlserr || c->insecure) ? 'U' : 'T';
+ else
+ pagestats[0] = '-';
pagestats[1] = '\0';
}
G_CALLBACK(createview), c);
g_signal_connect(G_OBJECT(v), "decide-policy",
G_CALLBACK(decidepolicy), c);
+ g_signal_connect(G_OBJECT(v), "insecure-content-detected",
+ G_CALLBACK(insecurecontent), c);
g_signal_connect(G_OBJECT(v), "load-changed",
G_CALLBACK(loadchanged), c);
g_signal_connect(G_OBJECT(v), "mouse-target-changed",
curconfig = defconfig;
setatom(c, AtomUri, title);
c->title = title;
- c->tlsflags = G_TLS_CERTIFICATE_VALIDATE_ALL + 1;
+ c->https = c->insecure = 0;
seturiparameters(c, geturi(c));
break;
case WEBKIT_LOAD_REDIRECTED:
seturiparameters(c, geturi(c));
break;
case WEBKIT_LOAD_COMMITTED:
- if (!webkit_web_view_get_tls_info(c->view, NULL,
- &(c->tlsflags)))
- c->tlsflags = G_TLS_CERTIFICATE_VALIDATE_ALL + 1;
-
+ c->https = webkit_web_view_get_tls_info(c->view, NULL,
+ &c->tlserr);
break;
case WEBKIT_LOAD_FINISHED:
/* Disabled until we write some WebKitWebExtension for
}
}
+void
+insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e, Client *c)
+{
+ c->insecure = 1;
+}
+
void
downloadstarted(WebKitWebContext *wc, WebKitDownload *d, Client *c)
{