1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-16 08:28:52 +01:00
pywb/static/wb.js
Ilya Kreymer e1b669fdea improved customization: can setup pywb_init.pywb_config() config,
or specify custom init module <initmodule>.py_config() by
setting PYWB_INIT=<initmodule>
fix run.sh to support testing with custom mount point
2014-01-24 12:25:27 -08:00

42 lines
939 B
JavaScript

// Rewritten location and domain obj setup
window.WB_wombat_location = window.location
if (window.top != window) {
window.top.WB_wombat_location = window.top.location
}
if (window.opener) {
window.opener.WB_wombat_location = window.opener.location
}
document.WB_wombat_domain = document.domain
function initBanner()
{
var BANNER_ID = "_wayback_banner";
var banner = document.getElementById(BANNER_ID);
if (!banner) {
banner = document.createElement("wb_div");
banner.setAttribute("id", BANNER_ID);
banner.setAttribute("lang", "en");
banner.innerHTML = "PyWb Archived Content"
document.body.insertBefore(banner, document.body.firstChild);
}
}
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "interactive" || document.readyState === "complete") {
initBanner();
clearInterval(readyStateCheckInterval);
}
}, 10);