summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-08-28 19:32:20 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-08-28 19:32:20 -0400
commitda1a34ae7065196dd8c459fac33983bbe5a66377 (patch)
tree5f2c13709e4d5612c1c86ec614c46d140e37c2dc
parentca0e7da014bf885d5f2acc887667368475f55520 (diff)
Even gentler handling of back-button returns to pages with stale message-passing credentials
-rw-r--r--lib/js/urweb.js18
1 files changed, 12 insertions, 6 deletions
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