From 3d29579a6cb3be321296c12e27dfbf90fc9e26f9 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 14 Nov 2010 22:47:04 +0000 Subject: Add tests --- tests/surfuri_js.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/surfuri_js.patch (limited to 'tests/surfuri_js.patch') diff --git a/tests/surfuri_js.patch b/tests/surfuri_js.patch new file mode 100644 index 0000000..bed2a46 --- /dev/null +++ b/tests/surfuri_js.patch @@ -0,0 +1,19 @@ +diff -r a62107a88a10 surf.c +--- a/surf.c Sun Aug 08 17:32:38 2010 +0100 ++++ b/surf.c Sun Nov 14 21:28:00 2010 +0000 +@@ -464,6 +464,15 @@ + + if(strcmp(uri, "") == 0) + return; ++ if(g_strrstr(uri, "javascript:")) { ++ JSStringRef jsscript; ++ JSValueRef exception = NULL; ++ jsscript = JSStringCreateWithUTF8CString(g_strdup(uri)); ++ WebKitWebFrame* frame = webkit_web_view_get_main_frame(c->view); ++ JSContextRef js = webkit_web_frame_get_global_context(frame); ++ JSEvaluateScript(js, jsscript, JSContextGetGlobalObject(js), NULL, 0, &exception); ++ return; ++ } + u = g_strrstr(uri, "://") ? g_strdup(uri) + : g_strdup_printf("http://%s", uri); + /* prevents endless loop */ -- cgit v1.2.3