summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2017-04-21 00:03:55 +0200
committerDaniel Carl <danielcarl@gmx.de>2017-04-21 00:03:55 +0200
commit5f65084c7082b71f4509e1b17841f8fbff80d918 (patch)
tree393361825179ef600ea689f460083f31bc205101 /src/normal.c
parent1b39ab0ba4e4ecad746c934bd89ba0938ff0e04d (diff)
Run js for scrolling from webextension #367.
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/normal.c b/src/normal.c
index be5e987..b7d9234 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -688,19 +688,19 @@ static VbResult normal_scroll(Client *c, const NormalCmdInfo *info)
js = g_strdup_printf(
"window.scroll(window.scrollX, %d * (1 + (document.height - window.innerHeight) / 100));",
info->count);
- webkit_web_view_run_javascript(c->webview, js, NULL, NULL, NULL);
+ ext_proxy_eval_script(c, js);
g_free(js);
return RESULT_COMPLETE;
}
/* Without count scroll to the end of the page. */
- webkit_web_view_run_javascript(c->webview, "window.scroll(window.scrollX, document.body.scrollHeight);", NULL, NULL, NULL);
+ ext_proxy_eval_script(c, "window.scroll(window.scrollX, document.body.scrollHeight);");
return RESULT_COMPLETE;
case '0':
- webkit_web_view_run_javascript(c->webview, "window.scroll(0, window.scrollY);", NULL, NULL, NULL);
+ ext_proxy_eval_script(c, "window.scroll(0, window.scrollY);");
return RESULT_COMPLETE;
case '$':
- webkit_web_view_run_javascript(c->webview, "window.scroll(document.body.scrollWidth, window.scrollY);", NULL, NULL, NULL);
+ ext_proxy_eval_script(c, "window.scroll(document.body.scrollWidth, window.scrollY);");
return RESULT_COMPLETE;
default:
if (info->key2 == 'g') {
@@ -708,18 +708,18 @@ static VbResult normal_scroll(Client *c, const NormalCmdInfo *info)
js = g_strdup_printf(
"window.scroll(window.scrollX, %d * (1 + (document.height - window.innerHeight) / 100));",
info->count);
- webkit_web_view_run_javascript(c->webview, js, NULL, NULL, NULL);
+ ext_proxy_eval_script(c, js);
g_free(js);
return RESULT_COMPLETE;
}
/* Without count gg scrolls to the top of the page. */
- webkit_web_view_run_javascript(c->webview, "window.scroll(window.scrollX, 0);", NULL, NULL, NULL);
+ ext_proxy_eval_script(c, "window.scroll(window.scrollX, 0);");
return RESULT_COMPLETE;
}
return RESULT_ERROR;
}
js = g_strdup_printf("window.scrollBy(%d,%d);", x, y);
- webkit_web_view_run_javascript(c->webview, js, NULL, NULL, NULL);
+ ext_proxy_eval_script(c, js);
g_free(js);
return RESULT_COMPLETE;