diff --git a/pywb/static/wombat.js b/pywb/static/wombat.js index 6e76cd04..c765e683 100644 --- a/pywb/static/wombat.js +++ b/pywb/static/wombat.js @@ -561,20 +561,17 @@ WB_wombat_init = (function() { var created = orig.apply(this, arguments); - if (created.tagName == "IFRAME" - //|| created.tagName == "IMG" - //|| created.tagName == "SCRIPT" - ) { - + if (created.tagName == "IFRAME") { if (created.contentWindow) { created.contentWindow.window.WB_wombat_location = created.contentWindow.window.location; } override_attr(created, "src"); - - } else if (created.tagName == "A") { - override_attr(created, "href"); } + +// } else if (created.tagName == "A") { +// override_attr(created, "href"); +// } return created; } @@ -704,14 +701,22 @@ WB_wombat_init = (function() { } var is_framed = (window.top.wbinfo && window.top.wbinfo.is_frame); + + function find_next_top(win) { + while ((win.parent != win) && (win.parent != win.top)) { + win = win.parent; + } + return win; + } if (window.self.location != window.top.location) { if (is_framed) { window.top.WB_wombat_location = window.WB_wombat_location; - window.WB_wombat_top = window.self; + + window.WB_wombat_top = find_next_top(window.self); + } else { window.top.WB_wombat_location = new WombatLocation(window.top.location); - window.WB_wombat_top = window.top; } } else { diff --git a/pywb/ui/frame_insert.html b/pywb/ui/frame_insert.html index da6f37be..d8e7b6d9 100644 --- a/pywb/ui/frame_insert.html +++ b/pywb/ui/frame_insert.html @@ -39,10 +39,7 @@ function push_state(url, timestamp, capture_str) { if (window.frames[0].WB_wombat_location) { curr_href = window.frames[0].WB_wombat_location.href; } - - console.log(curr_href); - console.log(url); - + if (url != curr_href) { update_status(capture_str); return;