From 426b18598286e435c8e12f1c861f43124de86410 Mon Sep 17 00:00:00 2001 From: Ian Ramzy Date: Sun, 5 Apr 2020 14:28:50 -0400 Subject: [PATCH] add not supported page --- public/js/chat.js | 12 +++- public/notsupported.html | 147 +++++++++++++++++++++++++++++++++++++++ server.js | 4 ++ 3 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 public/notsupported.html diff --git a/public/js/chat.js b/public/js/chat.js index d060929..c42ff56 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -796,12 +796,22 @@ function togglePictureInPicture() { // function startUp() { + if ( + /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( + navigator.userAgent + ) + ) { + alert( + "Zipcall is not currently supported on mobile. Please try again on dekstop." + ); + window.location.href = "/notsupported"; + } // Redirect unsupported browsers if (!isWebRTCSupported || browserName === "MSIE") { alert( "Your browser doesn't support Zipcall. Please use Chrome, Firefox, or Safari on laptop/desktop." ); - window.location.href = "/"; + window.location.href = "/notsupported"; } document.title = "Zipcall - " + url.substring(url.lastIndexOf("/") + 1); diff --git a/public/notsupported.html b/public/notsupported.html new file mode 100644 index 0000000..5b87fc1 --- /dev/null +++ b/public/notsupported.html @@ -0,0 +1,147 @@ + + + + + + + Zipcall + + + + + + + + + + + +
+ +
+
+
+
+
+
+
+

+ Your browser is not supported. Please try Chrome, Safari, + or Firefox on a desktop/laptop browser. +

+
+ +
+
+
+
+
+
+ +
+ + + diff --git a/server.js b/server.js index 704d3fe..af357fc 100644 --- a/server.js +++ b/server.js @@ -45,6 +45,10 @@ app.get("/join/*", function (req, res) { } }); +app.get("/notsupported", function (req, res) { + res.sendFile(path.join(public, "notsupported.html")); +}); + app.use(express.static("public")); function logIt(msg, room) {