@@ -24,22 +24,14 @@ var Karma = function (socket, iframe, opener, navigator, location) {
2424
2525 var childWindow = null
2626 var navigateContextTo = function ( url ) {
27- reloadingContext = true
28-
2927 if ( self . config . useIframe === false ) {
3028 if ( childWindow === null || childWindow . closed === true ) {
3129 // If this is the first time we are opening the window, or the window is closed
3230 childWindow = opener ( 'about:blank' )
3331 }
3432 childWindow . location = url
35- childWindow . onLoad = function ( ) {
36- reloadingContext = false
37- }
3833 } else {
3934 iframe . src = url
40- iframe . onLoad = function ( ) {
41- reloadingContext = false
42- }
4335 }
4436 }
4537
@@ -113,6 +105,8 @@ var Karma = function (socket, iframe, opener, navigator, location) {
113105 this . stringify = stringify
114106
115107 var clearContext = function ( ) {
108+ reloadingContext = true
109+
116110 navigateContextTo ( 'about:blank' )
117111 }
118112
@@ -217,6 +211,7 @@ var Karma = function (socket, iframe, opener, navigator, location) {
217211 // reset hasError and reload the iframe
218212 hasError = false
219213 startEmitted = false
214+ reloadingContext = false
220215 self . config = cfg
221216 navigateContextTo ( constant . CONTEXT_URL )
222217
0 commit comments