diff options
Diffstat (limited to 'tests/surfuri_js.patch')
-rw-r--r-- | tests/surfuri_js.patch | 19 |
1 files changed, 19 insertions, 0 deletions
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 */ |