From ce0fe06349753b2ad1cfa7b0b1cfcaa77c4e47ab Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 19 May 2013 23:48:55 +0100 Subject: create javascript heartbeat and hook a script timeout to it --- desktop/browser.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'desktop/browser.c') diff --git a/desktop/browser.c b/desktop/browser.c index 12cc9c830..53e3f13bf 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -683,6 +683,16 @@ 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) +{ + static int count = 0; + LOG(("Continuing execution %d", count)); + count++; + if (count >= 2) { + return false; + } + return true; +} /* exported interface, documented in desktop/browser.h */ @@ -707,7 +717,7 @@ browser_window_create(enum browser_window_nav_flags flags, } /* new javascript context for window */ - bw->jsctx = js_newcontext(); + bw->jsctx = js_newcontext(10, gui_slow_script, NULL); /* Initialise common parts */ browser_window_initialise_common(bw, clone); -- cgit v1.2.3