From a8bb3cfce6dde8553090c671859c5805b65c0a0b Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Mon, 21 May 2018 11:56:03 -0700 Subject: [PATCH] default_banner fix: save last state for use with 'title' event changes -- use previous url, timestamp when changing title (#327) --- pywb/static/default_banner.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pywb/static/default_banner.js b/pywb/static/default_banner.js index 04a7ac9e..3497b0b0 100644 --- a/pywb/static/default_banner.js +++ b/pywb/static/default_banner.js @@ -88,6 +88,8 @@ This file is part of pywb, https://github.com/webrecorder/pywb return; } + var last_state = {}; + window.addEventListener("load", function() { if (window.wbinfo) { init("_wb_plain_banner"); @@ -107,8 +109,10 @@ This file is part of pywb, https://github.com/webrecorder/pywb if (type == "load" || type == "replace-url") { state = event.data; + last_state = state; title = event.data.title || title; } else if (type == "title") { + state = last_state; title = event.data.title; } else { return;