forked from materliu/livepool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-webkit.html
61 lines (51 loc) · 1.47 KB
/
node-webkit.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Starting LivePool...</title>
</head>
<body>
<div id="tips">Starting LivePool...</div>
<script>
// var gui = require('nw.gui');
// var proxy = require('./lib/livepool/proxy');
// var win = gui.Window.get();
// win.on('load', function() {
// win.maximize();
// });
// win.on('close', function() {
// this.hide();
// var self = this;
// proxy.initProxy(function() {
// self.close(true);
// });
// });
// win.on("closed", function() {
// win = null;
// })
// win.on('minimize', function() {
// this.hide();
// tray = new gui.Tray({
// icon: 'lib/webui/public/img/stackoverflow.png'
// })
// tray.on('click', function(e) {
// win.show();
// this.remove();
// tray = null;
// });
// });
var http = require('http');
var runner = null;
function checkUI() {
http.get('http://127.0.0.1:8002/js/underscore.js?t' + (new Date()).getTime(), function(res) {
if (res.statusCode == 200) {
clearInterval(runner);
location.href = 'http://127.0.0.1:8002';
// document.getElementById('main').src = 'http://127.0.0.1:8002';
}
}).on('error', function(e) {});
};
runner = setInterval(checkUI, 100);
</script>
</body>
</html>