# HG changeset patch # User Adam Chlipala # Date 1314574340 14400 # Node ID 4105f779de7be47e3a7cc29a1ae2faeabf72cfdb # Parent c3b5cf5c2f987d34a87cba2f46d48bdf6b06ba97 Even gentler handling of back-button returns to pages with stale message-passing credentials diff -r c3b5cf5c2f98 -r 4105f779de7b lib/js/urweb.js --- 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