Skip to content

Commit

Permalink
Evaluate javascript given to uri correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
keis committed Sep 15, 2016
1 parent b872e8a commit 57301c7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,11 +932,10 @@ IMPLEMENT_COMMAND (uri)
uzbl.state.uri = g_strdup (uri);

/* Evaluate javascript: URIs. */
if (g_str_has_prefix (uri, "javascript:")) {
GArray *argv = g_array_new (TRUE, FALSE, sizeof (gchar *));
g_array_append_val (argv, uri);
uzbl_commands_run_argv ("js", argv, NULL);
g_array_free (argv, FALSE);
static const char *js_protocol = "javascript:";
if (g_str_has_prefix (uri, js_protocol)) {
const gchar *js_code = uri + strlen (js_protocol);
uzbl_js_run_string_async (JSCTX_PAGE, js_code, NULL, NULL);
return;
}

Expand Down

0 comments on commit 57301c7

Please sign in to comment.