diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js index 167d3897a..e5f678759 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -37,6 +37,7 @@ import Tray from './lib/Tray'; | |||
37 | import Settings from './electron/Settings'; | 37 | import Settings from './electron/Settings'; |
38 | import handleDeepLink from './electron/deepLinking'; | 38 | import handleDeepLink from './electron/deepLinking'; |
39 | import { isPositionValid } from './electron/windowUtils'; | 39 | import { isPositionValid } from './electron/windowUtils'; |
40 | // import askFormacOSPermissions from './electron/macOSPermissions'; | ||
40 | import { appId } from './package.json'; // eslint-disable-line import/no-unresolved | 41 | import { appId } from './package.json'; // eslint-disable-line import/no-unresolved |
41 | import './electron/exception'; | 42 | import './electron/exception'; |
42 | 43 | ||
@@ -46,10 +47,14 @@ import { | |||
46 | } from './config'; | 47 | } from './config'; |
47 | import { asarPath } from './helpers/asar-helpers'; | 48 | import { asarPath } from './helpers/asar-helpers'; |
48 | import { isValidExternalURL } from './helpers/url-helpers'; | 49 | import { isValidExternalURL } from './helpers/url-helpers'; |
49 | /* eslint-enable import/first */ | 50 | import userAgent from './helpers/userAgent-helpers'; |
50 | 51 | ||
51 | const debug = require('debug')('Ferdi:App'); | 52 | const debug = require('debug')('Ferdi:App'); |
52 | 53 | ||
54 | // Globally set useragent to fix user agent override in service workers | ||
55 | debug('Set userAgent to ', userAgent()); | ||
56 | app.userAgentFallback = userAgent(); | ||
57 | |||
53 | // Keep a global reference of the window object, if you don't, the window will | 58 | // Keep a global reference of the window object, if you don't, the window will |
54 | // be closed automatically when the JavaScript object is garbage collected. | 59 | // be closed automatically when the JavaScript object is garbage collected. |
55 | let mainWindow; | 60 | let mainWindow; |
@@ -182,6 +187,7 @@ const createWindow = () => { | |||
182 | nodeIntegration: true, | 187 | nodeIntegration: true, |
183 | webviewTag: true, | 188 | webviewTag: true, |
184 | preload: path.join(__dirname, 'sentry.js'), | 189 | preload: path.join(__dirname, 'sentry.js'), |
190 | enableRemoteModule: true, | ||
185 | }, | 191 | }, |
186 | }); | 192 | }); |
187 | 193 | ||
@@ -291,8 +297,13 @@ const createWindow = () => { | |||
291 | } | 297 | } |
292 | }); | 298 | }); |
293 | 299 | ||
300 | // Asking for permissions like this currently crashes Ferdi | ||
301 | // if (isMac) { | ||
302 | // askFormacOSPermissions(); | ||
303 | // } | ||
304 | |||
294 | mainWindow.on('show', () => { | 305 | mainWindow.on('show', () => { |
295 | debug('Skip taskbar: false'); | 306 | debug('Skip taskbar: true'); |
296 | mainWindow.setSkipTaskbar(false); | 307 | mainWindow.setSkipTaskbar(false); |
297 | }); | 308 | }); |
298 | 309 | ||
@@ -308,7 +319,9 @@ const createWindow = () => { | |||
308 | } | 319 | } |
309 | }); | 320 | }); |
310 | 321 | ||
311 | if (!(settings.get('enableSystemTray') && settings.get('startMinimized'))) { | 322 | if (settings.get('startMinimized')) { |
323 | mainWindow.hide(); | ||
324 | } else { | ||
312 | mainWindow.show(); | 325 | mainWindow.show(); |
313 | } | 326 | } |
314 | }; | 327 | }; |