mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
wombat:
ajax: always explicitly add X-Requested-With: XMLHttpRequest to ajax requests mutation obs: don't rewrite <link rel=canonical> with node added observer
This commit is contained in:
parent
97df6300eb
commit
6a9c54c79b
@ -533,7 +533,8 @@ _WBWombat = (function() {
|
|||||||
async = true;
|
async = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return orig.call(this, method, url, async, user, password);
|
result = orig.call(this, method, url, async, user, password);
|
||||||
|
this.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||||
}
|
}
|
||||||
|
|
||||||
window.XMLHttpRequest.prototype.open = open_rewritten;
|
window.XMLHttpRequest.prototype.open = open_rewritten;
|
||||||
@ -741,6 +742,11 @@ _WBWombat = (function() {
|
|||||||
var r = records[i];
|
var r = records[i];
|
||||||
if (r.type == "childList") {
|
if (r.type == "childList") {
|
||||||
for (var j = 0; j < r.addedNodes.length; j++) {
|
for (var j = 0; j < r.addedNodes.length; j++) {
|
||||||
|
// skip canonical link tag, should have been handled by server-side rewrite
|
||||||
|
// (maybe skip all links?)
|
||||||
|
if (r.addedNodes[j].tagName == "LINK" && r.addedNodes[j].rel == "canonical") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
rewrite_attr(r.addedNodes[j], "href", rewrite_url);
|
rewrite_attr(r.addedNodes[j], "href", rewrite_url);
|
||||||
rewrite_attr(r.addedNodes[j], "src", rewrite_url);
|
rewrite_attr(r.addedNodes[j], "src", rewrite_url);
|
||||||
}
|
}
|
||||||
@ -871,7 +877,6 @@ _WBWombat = (function() {
|
|||||||
created.contentWindow.WB_wombat_location = created.contentWindow.location;
|
created.contentWindow.WB_wombat_location = created.contentWindow.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override_attr(created, "src");
|
override_attr(created, "src");
|
||||||
} else if (created.tagName && equals_any(created.tagName, SRC_TAGS)) {
|
} else if (created.tagName && equals_any(created.tagName, SRC_TAGS)) {
|
||||||
override_attr(created, "src");
|
override_attr(created, "src");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user