diff --git a/package-lock.json b/package-lock.json index 9e57ba8..ce995d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "homeworker-desktop", - "version": "1.1.21", + "version": "1.1.22", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7f5c0b8..540d389 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "support@homeworker.li" ], "productName": "Homeworker", - "version": "1.1.21", + "version": "1.1.22", "description": "Desktop app for Windows and MacOS", "main": "src/main.js", "scripts": { diff --git a/src/preload.js b/src/preload.js index e600d3e..0254df1 100644 --- a/src/preload.js +++ b/src/preload.js @@ -2,31 +2,16 @@ const { ipcRenderer } = require("electron") const os = require("os") const { getDisplayMedia } = require("./util/screenPicker") -// Got notification from websocket -document.addEventListener('websocketMessage|type:fcm-message', (event) => { - if(Notification.permission === "granted") { - const { notification, data } = event.message.payload - - if(data.link && window.location.href === data.link) return - - const notificationObject = new Notification(notification.title, data) - notificationObject.addEventListener("click", () => { - if(data.link) window.location = data.link - notificationObject.close() - }) - } -}) - window.addEventListener("load", () => { window.desktop = { call: true, darwin: os.type().toLocaleLowerCase() === "darwin", offerUnread: (unreadNotifications, unreadChatMessages) => ipcRenderer.invoke("unread_notifications", {unreadNotifications, unreadChatMessages}), } - window.navigator.mediaDevices.getDisplayMedia = getDisplayMedia // Sadly it is impossible to do that with an DomObserver witch leeds ti this mess setInterval(() => document.querySelectorAll("iframe").forEach(iframe => iframe.contentWindow.navigator.mediaDevices.getDisplayMedia = getDisplayMedia), 500) + window.navigator.mediaDevices.getDisplayMedia = getDisplayMedia }) console.log("Registered preload script")