From da1a34ae7065196dd8c459fac33983bbe5a66377 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 28 Aug 2011 19:32:20 -0400 Subject: Even gentler handling of back-button returns to pages with stale message-passing credentials --- lib/js/urweb.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/js') diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 42660bf0..4d9a1419 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -129,13 +129,17 @@ function pf(loc) { throw ("Pattern match failure (" + loc + ")"); } +var lameDuck = false; + function runHandlers(kind, ls, arg) { - if (ls == null) - alert(kind + ": " + arg); - for (; ls; ls = ls.next) - try { - exec({c:"a", f:{c:"a", f:ls.data, x:{c:"c", v:arg}}, x:{c:"c", v:null}}); - } catch (v) { } + if (!lameDuck) { + if (ls == null) + alert(kind + ": " + arg); + for (; ls; ls = ls.next) + try { + exec({c:"a", f:{c:"a", f:ls.data, x:{c:"c", v:arg}}, x:{c:"c", v:null}}); + } catch (v) { } + } } var errorHandlers = null; @@ -911,6 +915,8 @@ function listener() { var lines = text.split("\n"); if (lines.length == 1 && lines[0] == "R") { + lameDuck = true; + if (isPost) history.back(); else -- cgit v1.2.3