-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
executable file
·50 lines (38 loc) · 1.29 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
const {ipcMain,BrowserWindow,app} = require('electron');
// const io = require('socket.io-client');
app.on('window-all-closed', function() {
app.quit();
});
// const chromeApp = {
// ip:'http://172.17.16.46',
// // ip: 'http://localhost',
// port:'3000'
// };
//
// const msgList = {
// DEFAULT: 'url-for-chrome',
// VIDEO: 'video',
// CONNECTION: 'connection-success',
// HOME: 'homepage',
// SCROLL: "scroll"
// }
// connect to chrome app
// const socket = io.connect(chromeApp.ip + ":" + chromeApp.port);
// connect to chrome app success callback
// socket.on('connect',(event,msg)=>{
// console.log('re- is connected to server');
// });
// get url from browser and pass to chrome app
// ipcMain.on(msgList.CONNECTION, (event, msg) =>socket.emit(msgList.CONNECTION));
// ipcMain.on(msgList.DEFAULT, (event, url) => socket.emit(msgList.DEFAULT,url));
// ipcMain.on(msgList.VIDEO, (event, arg) => socket.emit(msgList.VIDEO));
// ipcMain.on(msgList.HOME, (event, arg) =>socket.emit(msgList.HOME));
app.on('ready', function() {
const mainWindow = new BrowserWindow({
icon: __dirname + '/icon.png',
autoHideMenuBar: true,
// frame: false
});
mainWindow.loadURL('file://' + __dirname + '/browser.html');
// mainWindow.openDevTools();
});