forked from sudhirnakka/teams-ubuntu-enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
100 lines (82 loc) · 3.08 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
'use strict';
process.env.ELECTRON_HIDE_INTERNAL_MODULES = 'true';
const electron = require('electron');
const app = electron.app;
const Menu = electron.Menu;
const BrowserWindow = electron.BrowserWindow;
const shell = electron.shell;
let mainWindow = null;
app.on('window-all-closed', function() {
if (process.platform !== 'darwin') {
app.quit();
}
});
var startupOpts = {
useContentSize: true,
width: 800,
height: 620,
center: true,
resizable: true,
alwaysOnTop: false,
fullscreen: false,
skipTaskbar: false,
kiosk: false,
title: 'Microsoft Teams',
icon: __dirname + '/favicon-256x256.png',
show: true,
frame: true,
disableAutoHideCursor: false,
autoHideMenuBar: false,
titleBarStyle: 'default',
webPreferences: {
webSecurity: false,
nodeIntegration: false,
renotify: true,
allowDisplayingInsecureContent: true,
allowRunningInsecureContent: true,
plugins: true,
preload: __dirname + '/inject/preload.js'
}
};
app.on('ready', function() {
Menu.setApplicationMenu(Menu.buildFromTemplate(require('./src/menus')));
mainWindow = new BrowserWindow(startupOpts);
mainWindow.loadURL('https://teams.microsoft.com', {
userAgent: 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136'
// userAgent: 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0'
// userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36'
});
mainWindow.on('closed', function() {
mainWindow = null;
});
mainWindow.webContents.on('new-window', function(event, url) {
event.preventDefault();
shell.openExternal(url);
});
mainWindow.show();
const intervalId = setInterval(function () {
mainWindow.webContents.executeJavaScript("var sheet = window.document.styleSheets[0];\n" +
"sheet.insertRule('.ts-unread-channel {background-color: bisque}', sheet.cssRules.length);")
}, 10000);
setTimeout(function () {
clearInterval(intervalId);
}, 40000);
});
// Hardware Acceleration
// Override software rendering list: ENABLED
// PWA
// Enable PWA full code cache: ENABLED
// Desktop PWAs: ENABLED
// Desktop PWAs Link Capturing: ENABLED
// WEBRTC
// Negotiation with GCM cipher suites for SRTP in WebRTC: ENABLED
// Negotiation with encrypted header extensions for SRTP in WebRTC: ENABLED
// WebRTC Stun origin header: ENABLED
// WebRTC Echo Canceller 3: ENABLED
// WebRTC new encode cpu load estimator: ENABLED
// WebRTC H.264 software video encoder/decoder: ENABLED
// Downloads
// Parallel downloading: ENABLED
// Verify that Setting work.
// Open Microsoft Teams in your browser.
// Start a private chat with someone and verify that the video chat icon switches from grey to purple and white. If so, you can start making video calls and you should also be able to make presentation.