From 099b85ed0a46e37dd7cb14fc1596cbb1b3eabce9 Mon Sep 17 00:00:00 2001 From: Jonathan Ginsburg Date: Tue, 19 Apr 2022 01:28:44 -0500 Subject: [PATCH] fix(client): error out when opening a new tab fails --- client/karma.js | 3 +++ static/karma.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/client/karma.js b/client/karma.js index 9e13d89df..117c1239b 100644 --- a/client/karma.js +++ b/client/karma.js @@ -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') { diff --git a/static/karma.js b/static/karma.js index 04c7ad322..f72f024ed 100644 --- a/static/karma.js +++ b/static/karma.js @@ -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') {