changeset 1553:4105f779de7b

Even gentler handling of back-button returns to pages with stale message-passing credentials
author Adam Chlipala <adam@chlipala.net>
date Sun, 28 Aug 2011 19:32:20 -0400
parents c3b5cf5c2f98
children 396e8d881205
files lib/js/urweb.js
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Sun Aug 28 17:16:54 2011 -0400
+++ b/lib/js/urweb.js	Sun Aug 28 19:32:20 2011 -0400
@@ -129,13 +129,17 @@
     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 @@
                 var lines = text.split("\n");
 
                 if (lines.length == 1 && lines[0] == "R") {
+                    lameDuck = true;
+
                     if (isPost)
                         history.back();
                     else