Introduction
Introduction Statistics Contact Development Disclaimer Help
adding automatic download for not supported files. - surf - surf browser, a Web…
git clone git://git.suckless.org/surf
Log
Files
Refs
README
LICENSE
---
commit 742fc7fac15ab2b67090e98a661b2ffc8a0bd5b8
parent a9d733bd9f8d4534ad06ff6467431803df8c7efd
Author: Enno Boland (tox) <[email protected]>
Date: Tue, 27 Oct 2009 08:26:21 +0100
adding automatic download for not supported files.
Diffstat:
M surf.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/surf.c b/surf.c
@@ -72,6 +72,7 @@ static void cleanup(void);
static void clipboard(Client *c, const Arg *arg);
static void context(WebKitWebView *v, GtkMenu *m, Client *c);
static char *copystr(char **str, const char *src);
+static gboolean decidedownload(WebKitWebView *v, WebKitWebFrame *f, WebKitNetw…
static gboolean decidewindow(WebKitWebView *v, WebKitWebFrame *f, WebKitNetwor…
static void destroyclient(Client *c);
static void destroywin(GtkWidget* w, Client *c);
@@ -233,12 +234,12 @@ destroyclient(Client *c) {
}
gboolean
-mime_policy_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRe…
- if(webkit_web_view_can_show_mime_type(web_view, mime_type))
- webkit_web_policy_decision_use(policy_decision);
- else
- webkit_web_policy_decision_download(policy_decision);
- return TRUE;
+decidedownload(WebKitWebView *v, WebKitWebFrame *f, WebKitNetworkRequest *r, g…
+ if(!webkit_web_view_can_show_mime_type(v, m)) {
+ webkit_web_policy_decision_download(p);
+ return TRUE;
+ }
+ return FALSE;
}
gboolean
@@ -485,6 +486,7 @@ newclient(void) {
g_signal_connect(G_OBJECT(c->view), "hovering-over-link", G_CALLBACK(l…
g_signal_connect(G_OBJECT(c->view), "create-web-view", G_CALLBACK(crea…
g_signal_connect(G_OBJECT(c->view), "new-window-policy-decision-reques…
+ g_signal_connect(G_OBJECT(c->view), "mime-type-policy-decision-request…
g_signal_connect(G_OBJECT(c->view), "download-requested", G_CALLBACK(i…
g_signal_connect(G_OBJECT(c->view), "window-object-cleared", G_CALLBAC…
g_signal_connect(G_OBJECT(c->view), "populate-popup", G_CALLBACK(conte…
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.