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

wombat fix: use __orig_parent when referencing top-frame, since window.parent is being overriden

This commit is contained in:
Ilya Kreymer 2015-02-10 15:02:08 -08:00
parent 78ae86b6b6
commit 148651680a
2 changed files with 7 additions and 4 deletions

View File

@ -107,7 +107,7 @@ function remove_event(name, func, object) {
}
function notify_top() {
if (window.parent != window.top) {
if (window.__orig_parent != window.top) {
return;
}
@ -119,9 +119,11 @@ function notify_top() {
return;
}
window.parent.update_wb_url(window.WB_wombat_location.href,
wbinfo.timestamp,
wbinfo.is_live);
if (window.__orig_parent && window.__orig_parent.update_wb_url) {
window.__orig_parent.update_wb_url(window.WB_wombat_location.href,
wbinfo.timestamp,
wbinfo.is_live);
}
remove_event("readystatechange", notify_top, document);
}

View File

@ -975,6 +975,7 @@ _WBWombat = (function() {
}
if (window.self.location != window.top.location) {
window.__orig_parent = window.parent;
if (is_framed) {
window.top.WB_wombat_location = window.WB_wombat_location;