diff options
-rw-r--r-- | appcache.js | 1 | ||||
-rw-r--r-- | pointless/viewer/init.js | 7 | ||||
-rw-r--r-- | popup.html | 17 |
3 files changed, 21 insertions, 4 deletions
diff --git a/appcache.js b/appcache.js index d51f775..d8c8187 100644 --- a/appcache.js +++ b/appcache.js | |||
@@ -13,6 +13,7 @@ class AppCache { | |||
13 | this.cacheName = "cache"; | 13 | this.cacheName = "cache"; |
14 | this.filesToCache = [ | 14 | this.filesToCache = [ |
15 | ".", | 15 | ".", |
16 | "popup.html", | ||
16 | "appcache.js", | 17 | "appcache.js", |
17 | "favicon.ico", | 18 | "favicon.ico", |
18 | 19 | ||
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() { | |||
29 | } | 29 | } |
30 | 30 | ||
31 | function checkPopupPermission() { | 31 | function checkPopupPermission() { |
32 | try { | 32 | const popup = window.open("popup.html"); |
33 | const popup = window.open(); | 33 | |
34 | popup.close(); | 34 | if (popup == null) { |
35 | } catch(error) { | ||
36 | const warningMessage = document.getElementById("warning"); | 35 | const warningMessage = document.getElementById("warning"); |
37 | warningMessage.textContent = "A pop-up blocker is active. Make sure to allow pop-ups on this website."; | 36 | warningMessage.textContent = "A pop-up blocker is active. Make sure to allow pop-ups on this website."; |
38 | } | 37 | } |
diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..f08241b --- /dev/null +++ b/popup.html | |||
@@ -0,0 +1,17 @@ | |||
1 | <!doctype html> | ||
2 | |||
3 | <!-- | ||
4 | popup.html | ||
5 | Part of Pointless Viewer, a Beamer presentation viewer | ||
6 | Copyright 2018 Pacien TRAN-GIRARD | ||
7 | License: GNU GPL v3 | ||
8 | --> | ||
9 | |||
10 | <html> | ||
11 | <head> | ||
12 | <meta charset="utf-8"> | ||
13 | </head> | ||
14 | <body> | ||
15 | <script>window.close();</script> | ||
16 | </body> | ||
17 | </html> | ||