File tree 2 files changed +18
-5
lines changed
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ this.load = function() {
136
136
137
137
window . _wb_js_inited = true ;
138
138
139
+ // Non-Framed Replay OR top frame for framed replay!
139
140
if ( window . wbinfo && ( ! window . __WB_top_frame || window . __WB_top_frame == window ) ) {
140
141
if ( wbinfo . is_framed && wbinfo . mod != "bn_" ) {
141
142
var hash = window . location . hash ;
@@ -154,6 +155,7 @@ this.load = function() {
154
155
// Init Banner (no frame or top frame)
155
156
add_event ( "readystatechange" , init_banner , document ) ;
156
157
158
+ // Framed Replay
157
159
} else if ( window . __WB_top_frame && window != window . __WB_top_frame && window . __WB_top_frame . update_wb_url ) {
158
160
add_event ( "readystatechange" , notify_top , document ) ;
159
161
}
Original file line number Diff line number Diff line change @@ -2111,25 +2111,36 @@ var wombat_internal = function($wbwindow) {
2111
2111
}
2112
2112
2113
2113
function init_top_frame ( $wbwindow ) {
2114
- function check_frame ( win , frame ) {
2114
+ function next_parent ( win ) {
2115
2115
try {
2116
- return ( win && win . wbinfo && ( ! win . wbinfo . is_frame == ! frame ) ) ;
2116
+ if ( ! win ) {
2117
+ return false ;
2118
+ }
2119
+
2120
+ // if no wbinfo, see if _wb_wombat was set (eg. if about:blank page)
2121
+ if ( ! win . wbinfo ) {
2122
+ return ( win . _wb_wombat != undefined ) ;
2123
+ } else {
2124
+ // otherwise, ensure that it is not a top container frame
2125
+ return ! win . wbinfo . is_frame ;
2126
+ }
2127
+
2117
2128
} catch ( e ) {
2118
2129
return false ;
2119
2130
}
2120
2131
}
2121
-
2132
+
2122
2133
var replay_top = $wbwindow ;
2123
2134
2124
- while ( ( replay_top . parent != replay_top ) && check_frame ( replay_top . parent , false ) ) {
2135
+ while ( ( replay_top . parent != replay_top ) && next_parent ( replay_top . parent ) ) {
2125
2136
replay_top = replay_top . parent ;
2126
2137
}
2127
2138
2128
2139
$wbwindow . __WB_replay_top = replay_top ;
2129
2140
2130
2141
var real_parent = replay_top . __WB_orig_parent || replay_top . parent ;
2131
2142
2132
- if ( real_parent != $wbwindow && check_frame ( real_parent , true ) ) {
2143
+ if ( real_parent != $wbwindow && real_parent && real_parent . wbinfo && real_parent . wbinfo . is_frame ) {
2133
2144
$wbwindow . __WB_top_frame = real_parent ;
2134
2145
2135
2146
// Disable frameElement also as this should be top frame
You can’t perform that action at this time.
0 commit comments