-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
39 lines (30 loc) · 879 Bytes
/
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
'use strict';
const electron = require('electron');
const logger = require('tracer').colorConsole();
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const shell = require('electron').shell;
var mainWindow = null;
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit();
}
});
app.dock.setBadge('■');
app.on('ready', function() {
mainWindow = new BrowserWindow({width: 1400, height: 1200});
mainWindow.loadURL('https://feedly.com');
mainWindow.webContents.openDevTools();
mainWindow.webContents.on('new-window', function(e, url) {
if(url.indexOf('feedly.com') > -1) {
logger.debug(url);
} else {
e.preventDefault();
shell.openExternal(url);
}
});
mainWindow.on('closed', function() {
app.dock.setBadge('');
mainWindow = null;
});
});