summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2013-05-19 23:48:55 +0100
committerVincent Sanders <vince@netsurf-browser.org>2013-05-22 19:12:26 +0100
commitce0fe06349753b2ad1cfa7b0b1cfcaa77c4e47ab (patch)
tree695b26567b3277cc799ee5d925cf9a46454fb806 /desktop
parent447c0fc2715ef690f47bda0da60ee3c3d750950d (diff)
downloadnetsurf-ce0fe06349753b2ad1cfa7b0b1cfcaa77c4e47ab.tar.gz
netsurf-ce0fe06349753b2ad1cfa7b0b1cfcaa77c4e47ab.tar.bz2
create javascript heartbeat and hook a script timeout to it
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.c12
1 files changed, 11 insertions, 1 deletions
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);