Skip to content

Commit 1631474

Browse files
fix(client): Wait for iframe to be loaded
We need to wait for the iframe to be loaded before we can set reloadingContext to false. Closes karma-runner#1652
1 parent e780c9d commit 1631474

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client/karma.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@ var Karma = function (socket, iframe, opener, navigator, location) {
2525
var childWindow = null
2626
var navigateContextTo = function (url) {
2727
reloadingContext = true
28+
2829
if (self.config.useIframe === false) {
2930
if (childWindow === null || childWindow.closed === true) {
3031
// If this is the first time we are opening the window, or the window is closed
3132
childWindow = opener('about:blank')
3233
}
3334
childWindow.location = url
35+
reloadingContext = false
3436
} else {
3537
iframe.src = url
38+
iframe.onLoad = function () {
39+
reloadingContext = false
40+
}
3641
}
37-
reloadingContext = false
3842
}
3943

4044
this.setupContext = function (contextWindow) {

0 commit comments

Comments
 (0)