From c76619549afc86fc8912451113347f9e7153c8d1 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 21 Jul 2018 19:51:27 +0200 Subject: Use self-closing page for popup check --- pointless/viewer/init.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pointless/viewer') diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js index cb01fab..5f04eac 100644 --- a/pointless/viewer/init.js +++ b/pointless/viewer/init.js @@ -29,10 +29,9 @@ function initCache() { } function checkPopupPermission() { - try { - const popup = window.open(); - popup.close(); - } catch(error) { + const popup = window.open("popup.html"); + + if (popup == null) { const warningMessage = document.getElementById("warning"); warningMessage.textContent = "A pop-up blocker is active. Make sure to allow pop-ups on this website."; } -- cgit v1.2.3