aboutsummaryrefslogtreecommitdiff
path: root/client-web
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-03-17 16:44:15 +0100
committermetamuffin <metamuffin@disroot.org>2024-03-17 16:44:15 +0100
commitf11b04cd0b093fc11b156105b6aff470e70c54a3 (patch)
treebf4e68b42c0d5e50095361a2af39c1ccc349a921 /client-web
parentc8063785853e516280cd68e9d8e9ae79b2081989 (diff)
downloadkeks-meet-f11b04cd0b093fc11b156105b6aff470e70c54a3.tar
keks-meet-f11b04cd0b093fc11b156105b6aff470e70c54a3.tar.bz2
keks-meet-f11b04cd0b093fc11b156105b6aff470e70c54a3.tar.zst
replace window with globalThis
Diffstat (limited to 'client-web')
-rw-r--r--client-web/source/helper.ts2
-rw-r--r--client-web/source/index.ts6
-rw-r--r--client-web/source/keybinds.ts2
-rw-r--r--client-web/source/rnnoise.ts6
4 files changed, 8 insertions, 8 deletions
diff --git a/client-web/source/helper.ts b/client-web/source/helper.ts
index 51036a1..655d894 100644
--- a/client-web/source/helper.ts
+++ b/client-web/source/helper.ts
@@ -60,7 +60,7 @@ export function image_view(url: string, opts?: Opts<HTMLElement>): HTMLElement {
img.src = url
img.alt = `Image (click to open)`
img.addEventListener("click", () => {
- window.open(url, "_blank", `noreferrer=true,noopener=true,popup=${PREFS.image_view_popup}`)
+ globalThis.open(url, "_blank", `noreferrer=true,noopener=true,popup=${PREFS.image_view_popup}`)
})
return img
}
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index b085cb8..0ae9d66 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -16,7 +16,7 @@ import { control_bar, info_br } from "./menu.ts";
import { Chat } from "./chat.ts"
export const VERSION = "1.0.1"
-window.onload = () => main()
+globalThis.onload = () => main()
export interface ClientConfig {
appearance?: {
@@ -102,11 +102,11 @@ export async function main() {
if (room_secret.length != 0) {
set_room(state, room_secret, rtc_config)
}
- window.onhashchange = () => {
+ globalThis.onhashchange = () => {
const new_secret = load_params().rsecret;
set_room(state, new_secret, rtc_config)
}
- window.onbeforeunload = ev => {
+ globalThis.onbeforeunload = ev => {
if (state.room && state.room.local_user.resources.size != 0 && PREFS.enable_onbeforeunload) {
ev.preventDefault()
return ev.returnValue = "You have local resources shared. Really quit?"
diff --git a/client-web/source/keybinds.ts b/client-web/source/keybinds.ts
index 09fbb34..047fe97 100644
--- a/client-web/source/keybinds.ts
+++ b/client-web/source/keybinds.ts
@@ -24,7 +24,7 @@ export function setup_keybinds(state: AppState) {
if (ev.code == "KeyS") state.room?.local_user.await_add_resource(create_screencast_res())
if (ev.code == "KeyC" && !ev.ctrlKey) state.room?.local_user.await_add_resource(create_camera_res())
if (ev.code == "KeyC" && ev.ctrlKey) state.room?.local_user.resources.forEach(t => t.destroy())
- if (ev.code == "KeyU") if (window.confirm("really update?")) update_serviceworker()
+ if (ev.code == "KeyU") if (globalThis.confirm("really update?")) update_serviceworker()
if (ev.code == "KeyV") state.chat?.remove_oldest_message()
}
})
diff --git a/client-web/source/rnnoise.ts b/client-web/source/rnnoise.ts
index 21b44eb..b79f01e 100644
--- a/client-web/source/rnnoise.ts
+++ b/client-web/source/rnnoise.ts
@@ -22,7 +22,7 @@ declare global {
export async function get_rnnoise_node(context: AudioContext): Promise<RNNoiseNode> {
log("rnnoise", "enabled")
//@ts-ignore asfdasfd
- let RNNoiseNode: typeof RNNoiseNode = window.RNNoiseNode;
+ let RNNoiseNode: typeof RNNoiseNode = globalThis.RNNoiseNode;
let script: HTMLScriptElement;
if (!RNNoiseNode) {
@@ -32,9 +32,9 @@ export async function get_rnnoise_node(context: AudioContext): Promise<RNNoiseNo
script.defer = true
document.head.appendChild(script)
//@ts-ignore asdfsfad
- while (!window.RNNoiseNode) await new Promise<void>(r => setTimeout(() => r(), 100))
+ while (!globalThis.RNNoiseNode) await new Promise<void>(r => setTimeout(() => r(), 100))
//@ts-ignore asfdsadfsafd
- RNNoiseNode = window.RNNoiseNode;
+ RNNoiseNode = globalThis.RNNoiseNode;
log("rnnoise", "loaded")
}