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:
parent
18cc71af3b
commit
a8bb3cfce6
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user