Skip to content

Commit 099b85e

Browse files
author
Jonathan Ginsburg
committedApr 19, 2022
fix(client): error out when opening a new tab fails
1 parent b659015 commit 099b85e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎client/karma.js

+3
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ function Karma (updater, socket, iframe, opener, navigator, location, document)
9494
childWindow.close()
9595
}
9696
childWindow = opener(url)
97+
if (childWindow === null) {
98+
self.error('Opening a new tab/window failed, probably because pop-ups are blocked.')
99+
}
97100
// run context on parent element (client_with_context)
98101
// using window.__karma__.scriptUrls to get the html element strings and load them dynamically
99102
} else if (url !== 'about:blank') {

‎static/karma.js

+3
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ function Karma (updater, socket, iframe, opener, navigator, location, document)
104104
childWindow.close()
105105
}
106106
childWindow = opener(url)
107+
if (childWindow === null) {
108+
self.error('Opening a new tab/window failed, probably because pop-ups are blocked.')
109+
}
107110
// run context on parent element (client_with_context)
108111
// using window.__karma__.scriptUrls to get the html element strings and load them dynamically
109112
} else if (url !== 'about:blank') {

0 commit comments

Comments
 (0)
Please sign in to comment.