1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

default_banner fix: save last state for use with 'title' event changes -- use previous url, timestamp when changing title (#327)

This commit is contained in:
Ilya Kreymer 2018-05-21 11:56:03 -07:00 committed by GitHub
parent 18cc71af3b
commit a8bb3cfce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;