aboutsummaryrefslogtreecommitdiff
path: root/pointless/viewer
diff options
context:
space:
mode:
authorpacien2018-07-21 17:01:32 +0200
committerpacien2018-07-21 17:01:32 +0200
commit79ccb5ac88a88d06713e8fe293e99d4f67e4a6d8 (patch)
tree8a97f9b1a0c3cf39ed09c223151fc29f65c69e40 /pointless/viewer
parent29eba60e321667b73f9c97d73e55be69b344ef1b (diff)
downloadbeamer-viewer-79ccb5ac88a88d06713e8fe293e99d4f67e4a6d8.tar.gz
Add preemptive popup check
Diffstat (limited to 'pointless/viewer')
-rw-r--r--pointless/viewer/init.js11
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
31function 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
31function init() { 41function init() {
32 initCache(); 42 initCache();
43 checkPopupPermission();
33 44
34 const viewer = new Viewer(); 45 const viewer = new Viewer();
35 46