Skip to content

Commit

Permalink
fix(client): Wait for iframe to be loaded
Browse files Browse the repository at this point in the history
We need to wait for the iframe to be loaded before we can set
reloadingContext to false.

Closes #1652
  • Loading branch information
dignifiedquire committed Oct 22, 2015
1 parent e780c9d commit 1631474
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/karma.js
Expand Up @@ -25,16 +25,20 @@ var Karma = function (socket, iframe, opener, navigator, location) {
var childWindow = null
var navigateContextTo = function (url) {
reloadingContext = true

if (self.config.useIframe === false) {
if (childWindow === null || childWindow.closed === true) {
// If this is the first time we are opening the window, or the window is closed
childWindow = opener('about:blank')
}
childWindow.location = url
reloadingContext = false
} else {
iframe.src = url
iframe.onLoad = function () {
reloadingContext = false
}
}
reloadingContext = false
}

this.setupContext = function (contextWindow) {
Expand Down

0 comments on commit 1631474

Please sign in to comment.