From af75070bee41816cb9ee4a53995d1f42870c1fcb Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 22 May 2013 18:40:21 +0100 Subject: add script_timeout option and use it --- desktop/browser.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'desktop/browser.c') diff --git a/desktop/browser.c b/desktop/browser.c index 53e3f13bf..ac8c6991c 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -683,12 +683,15 @@ void browser_window_debug_dump(struct browser_window *bw, FILE *f) content_debug_dump(bw->current_content, f); } -static bool gui_slow_script(void *ctx) +/** slow script handler +*/ +static bool slow_script(void *ctx) { static int count = 0; LOG(("Continuing execution %d", count)); count++; - if (count >= 2) { + if (count > 1) { + count = 0; return false; } return true; @@ -717,7 +720,9 @@ browser_window_create(enum browser_window_nav_flags flags, } /* new javascript context for window */ - bw->jsctx = js_newcontext(10, gui_slow_script, NULL); + bw->jsctx = js_newcontext(nsoption_int(script_timeout), + slow_script, + NULL); /* Initialise common parts */ browser_window_initialise_common(bw, clone); -- cgit v1.2.3