summaryrefslogtreecommitdiff
path: root/client-web/source/index.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-10-26 23:54:33 +0200
committermetamuffin <metamuffin@disroot.org>2022-10-26 23:54:33 +0200
commit2a83c8bdbdd5a67b6068420520e83524f4a6f6bd (patch)
tree8638903b93eb929ca74e5027a1816820ff0bc346 /client-web/source/index.ts
parentd0162d41438c7ee3d9bc5321f73ed33defc443a3 (diff)
downloadkeks-meet-2a83c8bdbdd5a67b6068420520e83524f4a6f6bd.tar
keks-meet-2a83c8bdbdd5a67b6068420520e83524f4a6f6bd.tar.bz2
keks-meet-2a83c8bdbdd5a67b6068420520e83524f4a6f6bd.tar.zst
some code for streamed downloads
Diffstat (limited to 'client-web/source/index.ts')
-rw-r--r--client-web/source/index.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index c16fa23..277bf00 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -5,6 +5,7 @@
*/
/// <reference lib="dom" />
+import { init_serviceworker } from "./sw/init.ts";
import { ediv, OVERLAYS } from "./helper.ts";
import { setup_keybinds } from "./keybinds.ts";
import { log, LOGGER_CONTAINER } from "./logger.ts"
@@ -56,6 +57,7 @@ export async function main() {
if (!globalThis.RTCPeerConnection) return log({ scope: "webrtc", error: true }, "WebRTC not supported.")
if (!globalThis.isSecureContext) log({ scope: "*", warn: true }, "This page is not in a 'Secure Context'")
if (!globalThis.crypto.subtle) return log({ scope: "crypto", error: true }, "SubtleCrypto not availible")
+ if (!globalThis.navigator.serviceWorker) log({ scope: "*", warn: true }, "Your browser does not support the Service Worker API, some features dont work without it.")
if (room_name.length < 8) log({ scope: "crypto", warn: true }, "Room name is very short. e2ee is insecure!")
if (room_name.length == 0) return window.location.href = "/" // send them back to the start page
if (PREFS.warn_redirect) log({ scope: "crypto", warn: true }, "You were redirected from the old URL format. The server knows the room name now - e2ee is insecure!")
@@ -69,4 +71,6 @@ export async function main() {
new MenuBr().shown = true
}
document.body.append(ROOM_CONTAINER, OVERLAYS, LOGGER_CONTAINER)
+
+ if (globalThis.navigator.serviceWorker) init_serviceworker()
}