From 30959446b17bea49d07d2ded62f3fc5b978be330 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 28 Aug 2011 17:16:54 -0400 Subject: Gentle handling of back-button returns to pages with stale message-passing credentials --- lib/js/urweb.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/js/urweb.js b/lib/js/urweb.js index f0d9b693..42660bf0 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -736,6 +736,7 @@ var client_id = null; var client_pass = 0; var url_prefix = "/"; var timeout = 60; +var isPost = false; function getXHR(uri) { @@ -909,6 +910,15 @@ function listener() { return; var lines = text.split("\n"); + if (lines.length == 1 && lines[0] == "R") { + if (isPost) + history.back(); + else + location.reload(); + + return; + } + if (lines.length < 2) { discon(); return; -- cgit v1.2.3