1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

wombat: also override frameElement when changing window.parent for top-level replay frame

This commit is contained in:
Ilya Kreymer 2015-02-11 19:26:45 -08:00
parent 0b72bfe911
commit dcf3688dc3

View File

@ -529,10 +529,11 @@ _WBWombat = (function() {
if (equals_any(lowername, REWRITE_ATTRS) && typeof(value) == "string") {
if (!this._no_rewrite) {
var old_value = value;
value = rewrite_url(value);
if (value != old_value) {
var new_value = rewrite_url(value);
if (new_value != old_value) {
this._no_rewrite = true;
}
value = new_value;
}
}
}
@ -983,8 +984,12 @@ _WBWombat = (function() {
if (window.parent == window.top) {
window.parent = window;
// Disable frameElement also as this should be top frame
if (Object.defineProperty) {
Object.defineProperty(window, "frameElement", {value: undefined, configurable: false});
}
}
} else {
window.top.WB_wombat_location = new WombatLocation(window.top.location);
window.WB_wombat_top = window.top;