mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-28 08:32:29 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var last_state = {};
|
||||||
|
|
||||||
window.addEventListener("load", function() {
|
window.addEventListener("load", function() {
|
||||||
if (window.wbinfo) {
|
if (window.wbinfo) {
|
||||||
init("_wb_plain_banner");
|
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") {
|
if (type == "load" || type == "replace-url") {
|
||||||
state = event.data;
|
state = event.data;
|
||||||
|
last_state = state;
|
||||||
title = event.data.title || title;
|
title = event.data.title || title;
|
||||||
} else if (type == "title") {
|
} else if (type == "title") {
|
||||||
|
state = last_state;
|
||||||
title = event.data.title;
|
title = event.data.title;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user