diff --git a/app/lib/browser/index.js b/app/lib/browser/index.js index 8f1171f7..df7c7e2a 100644 --- a/app/lib/browser/index.js +++ b/app/lib/browser/index.js @@ -4,7 +4,6 @@ const path = require('path'); const { ipcRenderer } = require('electron'); const trayNotifications = require('./tray-notifications'); - // const nativeNotifications = require('./native-notifications'); require('./zoom')(); const iconPath = path.join(__dirname, '../assets/icons/icon-96x96.png'); @@ -14,10 +13,9 @@ iconPath }); - // document.addEventListener( - // 'DOMContentLoaded', - // nativeNotifications({ - // ipc: ipcRenderer, - // iconPath - // })); + //change userAgent to chrome to fix the issue of notifications disapearing. + document.addEventListener( + 'DOMContentLoaded', + navigator.__defineGetter__('userAgent', () => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/12.246') + ); })(); diff --git a/app/lib/config/index.js b/app/lib/config/index.js index 5669941d..bf7a9bf6 100644 --- a/app/lib/config/index.js +++ b/app/lib/config/index.js @@ -31,7 +31,7 @@ function argv(configPath) { describe: 'Microsoft Edge User Agent', type: 'string', default: - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134' + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/12.246' }, chromeUserAgent: { describe: 'Google Chrome User Agent', diff --git a/app/lib/index.js b/app/lib/index.js index 1b4764dd..bd9ea736 100755 --- a/app/lib/index.js +++ b/app/lib/index.js @@ -7,7 +7,7 @@ const NativeNotification = require('electron-native-notification'); const Menus = require('./menus'); const configBuilder = require('./config'); -function createWindow(config, iconPath) { +function createWindow(part, iconPath) { // Load the previous state with fallback to defaults let windowState = windowStateKeeper({ defaultWidth: 0, @@ -28,7 +28,7 @@ function createWindow(config, iconPath) { icon: path.join(__dirname, 'assets', 'icons', 'icon-96x96.png'), webPreferences: { - partition: config.partition, + partition: part, preload: path.join(__dirname, 'browser', 'index.js'), nativeWindowOpen: true, plugins: true, @@ -54,7 +54,7 @@ app.on('ready', () => { ); let isFirstLoginTry = true; const config = configBuilder(app.getPath('userData')); - var window = createWindow(config, iconPath); + var window = createWindow(config.partition, iconPath); let menus = new Menus(config, iconPath); menus.register(window); @@ -64,7 +64,7 @@ app.on('ready', () => { ipcMain.on('notifications', async (e, msg) => { if (msg.count > 0) { - const body = "You got " + msg.count + " notification(s). " + ((msg.text) ? " " + msg.text + " " : ""); + const body = ((msg.text) ? "(" + msg.count + "): " + msg.text : "You got " + msg.count + " notification(s)"); const notification = new NativeNotification( "Microsoft Teams", { @@ -93,13 +93,13 @@ app.on('ready', () => { app.exit(0); } }); - + if (config.userAgent === 'edge') { window.webContents.setUserAgent(config.edgeUserAgent); } else { window.webContents.setUserAgent(config.chromeUserAgent); - } - + } + window.once('ready-to-show', () => window.show()); window.webContents.on('did-finish-load', function () { diff --git a/app/package.json b/app/package.json index a76e0e0e..c8e6792a 100755 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "teams-for-linux", - "version": "0.1.6", + "version": "0.1.7", "description": "Microsoft Teams for Linux", "main": "lib/index.js", "author": "Ivelin Velkov ", diff --git a/package.json b/package.json index 1f031e04..d71b8f6b 100755 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "teams-for-linux", - "version": "0.1.6", + "version": "0.1.7", "description": "Unofficial client for Microsoft Teams for Linux", - "homepage": "https://github.com/JamieMagee/teams-for-linux", + "homepage": "https://github.com/IsmaelMartinez/teams-for-linux", "keywords": [ "Teams", "Microsoft Teams"