From 79ccb5ac88a88d06713e8fe293e99d4f67e4a6d8 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 21 Jul 2018 17:01:32 +0200 Subject: Add preemptive popup check --- index.html | 2 +- pointless/viewer/init.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index fa1ef21..ddcdbcf 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@ \setbeameroption{show notes on second screen=right})

-

+

diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js index a9294ea..cb01fab 100644 --- a/pointless/viewer/init.js +++ b/pointless/viewer/init.js @@ -28,8 +28,19 @@ function initCache() { offlineCapableIndicator.style.visibility = "visible"; } +function checkPopupPermission() { + try { + const popup = window.open(); + popup.close(); + } catch(error) { + const warningMessage = document.getElementById("warning"); + warningMessage.textContent = "A pop-up blocker is active. Make sure to allow pop-ups on this website."; + } +} + function init() { initCache(); + checkPopupPermission(); const viewer = new Viewer(); -- cgit v1.2.3