From 20cbd0be457d92f684a76feef1430cdd385367d4 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 7 Sep 2020 14:52:30 +0200 Subject: [PATCH] Fixed safari for the web client --- ChangeLog.md | 3 +++ package-lock.json | 5 +++++ package.json | 1 + shared/css/static/general.scss | 4 ++++ shared/js/ipc/BrowserIPC.ts | 3 +++ .../js/ui/frames/log/DispatcherNotifications.ts | 17 ++++++++++++----- web/app/index.ts | 1 + 7 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 5f55ca55..550de0b8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,7 @@ # Changelog: +* **07.09.20** + - Fixed the web client for safari + * **05.09.20** - Smoother voice playback start (web client only) diff --git a/package-lock.json b/package-lock.json index ee874314..500b9044 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2749,6 +2749,11 @@ "fill-range": "^7.0.1" } }, + "broadcastchannel-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/broadcastchannel-polyfill/-/broadcastchannel-polyfill-1.0.1.tgz", + "integrity": "sha512-iooPAN913j4xfrIu5o+mDaks9UUDOBfgjn8SsuzysfXr/X+f8m9y5t8c5rAbW6P0LdUXBJx33zwN4Cs6b9BGRw==" + }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", diff --git a/package.json b/package.json index 967c79f4..adab0d98 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ }, "homepage": "https://www.teaspeak.de", "dependencies": { + "broadcastchannel-polyfill": "^1.0.1", "detect-browser": "^5.1.1", "dompurify": "^2.0.8", "emoji-mart": "git+https://github.com/WolverinDEV/emoji-mart.git", diff --git a/shared/css/static/general.scss b/shared/css/static/general.scss index 2c27501b..d514b03b 100644 --- a/shared/css/static/general.scss +++ b/shared/css/static/general.scss @@ -180,4 +180,8 @@ a.rainbow-letter { iframe { border-radius: .2em; border: none; +} + +select, input { + -webkit-appearance: none; } \ No newline at end of file diff --git a/shared/js/ipc/BrowserIPC.ts b/shared/js/ipc/BrowserIPC.ts index 833d8326..4c3efc91 100644 --- a/shared/js/ipc/BrowserIPC.ts +++ b/shared/js/ipc/BrowserIPC.ts @@ -284,6 +284,9 @@ export function getInstanceConnectHandler() { } export function supported() { + /* we've a polyfill now */ + return true; + /* ios does not support this */ return typeof(window.BroadcastChannel) !== "undefined"; } \ No newline at end of file diff --git a/shared/js/ui/frames/log/DispatcherNotifications.ts b/shared/js/ui/frames/log/DispatcherNotifications.ts index 702d0c66..232dec9d 100644 --- a/shared/js/ui/frames/log/DispatcherNotifications.ts +++ b/shared/js/ui/frames/log/DispatcherNotifications.ts @@ -486,11 +486,18 @@ loader.register_task(Stage.LOADED, { if(Notification.permission === "granted") return; - Notification.requestPermission().then(result => { - log.info(LogCategory.GENERAL, tr("Notification permission request resulted in %s"), result); - }).catch(error => { - log.warn(LogCategory.GENERAL, tr("Failed to execute notification permission request: %O"), error); - }); + /* yeahr fuck safari */ + const promise = Notification.requestPermission(result => { + log.info(LogCategory.GENERAL, tr("Notification permission request (callback) resulted in %s"), result); + }) + + if(typeof promise !== "undefined" && 'then' in promise) { + promise.then(result => { + log.info(LogCategory.GENERAL, tr("Notification permission request resulted in %s"), result); + }).catch(error => { + log.warn(LogCategory.GENERAL, tr("Failed to execute notification permission request: %O"), error); + }); + } }, name: "Request notifications", priority: 1 diff --git a/web/app/index.ts b/web/app/index.ts index 417ceb78..c2a076b5 100644 --- a/web/app/index.ts +++ b/web/app/index.ts @@ -1,4 +1,5 @@ import "webrtc-adapter"; +import "broadcastchannel-polyfill"; import "./index.scss"; import "./FileTransfer";