mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
wombat: fix rewrite_attr not actually being rewritten due to incomplete refactor
when is_live, don't add timestamp to rewritten urls (hypothesis/via#11)
This commit is contained in:
parent
99ff29e283
commit
d657a65469
@ -747,7 +747,6 @@ _WBWombat = (function() {
|
|||||||
value = func(value);
|
value = func(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this now handles the actual rewrite
|
|
||||||
elem._orig_setAttribute(name, value);
|
elem._orig_setAttribute(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,8 +765,8 @@ _WBWombat = (function() {
|
|||||||
//============================================
|
//============================================
|
||||||
function rewrite_elem(elem)
|
function rewrite_elem(elem)
|
||||||
{
|
{
|
||||||
rewrite_attr(elem, "src");
|
rewrite_attr(elem, "src", rewrite_url);
|
||||||
rewrite_attr(elem, "href");
|
rewrite_attr(elem, "href", rewrite_url);
|
||||||
rewrite_attr(elem, "style", rewrite_style);
|
rewrite_attr(elem, "style", rewrite_style);
|
||||||
|
|
||||||
if (elem && elem.getAttribute && elem.getAttribute("crossorigin")) {
|
if (elem && elem.getAttribute && elem.getAttribute("crossorigin")) {
|
||||||
@ -827,6 +826,7 @@ _WBWombat = (function() {
|
|||||||
|
|
||||||
var created = orig.apply(this, arguments);
|
var created = orig.apply(this, arguments);
|
||||||
|
|
||||||
|
|
||||||
if (!created) {
|
if (!created) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1005,9 +1005,23 @@ _WBWombat = (function() {
|
|||||||
wb_opts = wbinfo.wombat_opts || {};
|
wb_opts = wbinfo.wombat_opts || {};
|
||||||
|
|
||||||
if (wb_replay_prefix) {
|
if (wb_replay_prefix) {
|
||||||
wb_replay_date_prefix = wb_replay_prefix + wbinfo.wombat_ts + wbinfo.mod + "/";
|
|
||||||
|
|
||||||
if (wbinfo.wombat_ts.length > 0) {
|
var ts_mod;
|
||||||
|
|
||||||
|
// if live, don't add the timestamp
|
||||||
|
if (wbinfo.is_live) {
|
||||||
|
ts_mod = wbinfo.mod;
|
||||||
|
} else {
|
||||||
|
ts_mod = wbinfo.wombat_ts + wbinfo.mod;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ts_mod != "") {
|
||||||
|
ts_mod += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
wb_replay_date_prefix = wb_replay_prefix + ts_mod;
|
||||||
|
|
||||||
|
if (!wbinfo.is_live && wbinfo.wombat_ts.length > 0) {
|
||||||
wb_capture_date_part = "/" + wbinfo.wombat_ts + "/";
|
wb_capture_date_part = "/" + wbinfo.wombat_ts + "/";
|
||||||
} else {
|
} else {
|
||||||
wb_capture_date_part = "";
|
wb_capture_date_part = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user