Skip to content

Commit

Permalink
fix(client): error out when opening a new tab fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Ginsburg committed Apr 19, 2022
1 parent b659015 commit 099b85e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ function Karma (updater, socket, iframe, opener, navigator, location, document)
childWindow.close()
}
childWindow = opener(url)
if (childWindow === null) {
self.error('Opening a new tab/window failed, probably because pop-ups are blocked.')
}
// run context on parent element (client_with_context)
// using window.__karma__.scriptUrls to get the html element strings and load them dynamically
} else if (url !== 'about:blank') {
Expand Down
3 changes: 3 additions & 0 deletions static/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ function Karma (updater, socket, iframe, opener, navigator, location, document)
childWindow.close()
}
childWindow = opener(url)
if (childWindow === null) {
self.error('Opening a new tab/window failed, probably because pop-ups are blocked.')
}
// run context on parent element (client_with_context)
// using window.__karma__.scriptUrls to get the html element strings and load them dynamically
} else if (url !== 'about:blank') {
Expand Down

0 comments on commit 099b85e

Please sign in to comment.