diff options
author | pacien | 2018-07-21 17:01:32 +0200 |
---|---|---|
committer | pacien | 2018-07-21 17:01:32 +0200 |
commit | 79ccb5ac88a88d06713e8fe293e99d4f67e4a6d8 (patch) | |
tree | 8a97f9b1a0c3cf39ed09c223151fc29f65c69e40 /pointless | |
parent | 29eba60e321667b73f9c97d73e55be69b344ef1b (diff) | |
download | beamer-viewer-79ccb5ac88a88d06713e8fe293e99d4f67e4a6d8.tar.gz |
Add preemptive popup check
Diffstat (limited to 'pointless')
-rw-r--r-- | pointless/viewer/init.js | 11 |
1 files changed, 11 insertions, 0 deletions
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() { | |||
28 | offlineCapableIndicator.style.visibility = "visible"; | 28 | offlineCapableIndicator.style.visibility = "visible"; |
29 | } | 29 | } |
30 | 30 | ||
31 | function checkPopupPermission() { | ||
32 | try { | ||
33 | const popup = window.open(); | ||
34 | popup.close(); | ||
35 | } catch(error) { | ||
36 | const warningMessage = document.getElementById("warning"); | ||
37 | warningMessage.textContent = "A pop-up blocker is active. Make sure to allow pop-ups on this website."; | ||
38 | } | ||
39 | } | ||
40 | |||
31 | function init() { | 41 | function init() { |
32 | initCache(); | 42 | initCache(); |
43 | checkPopupPermission(); | ||
33 | 44 | ||
34 | const viewer = new Viewer(); | 45 | const viewer = new Viewer(); |
35 | 46 | ||