diff --git a/static/js/reload.js b/static/js/reload.js index 265392c8ad..b550f8ab9d 100644 --- a/static/js/reload.js +++ b/static/js/reload.js @@ -15,6 +15,19 @@ exports.is_in_progress = function () { }; function preserve_state(send_after_reload, save_pointer, save_narrow, save_compose) { + if (!localstorage.supported()) { + // If local storage is not supported by the browser, we can't + // save the browser's position across reloads (since there's + // no secure way to pass that state in a signed fashion to the + // next instance of the browser client). + // + // So we jure return here and let the reload proceed without + // having preserved state. We keep the hash the same so we'll + // at least save their narrow state. + blueslip.log("Can't preserve state; no local storage."); + return; + } + if (send_after_reload === undefined) { send_after_reload = 0; }