-
Notifications
You must be signed in to change notification settings - Fork 3
/
chat.html
61 lines (47 loc) · 1.22 KB
/
chat.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>
<head>
<style>
html, body {
margin: 0;
padding: 0;
overflow: hidden;
}
html, body, iframe {
width: 100%;
height: 100%;
}
</style>
<script>
var fs = require('fs');
function run() {
var webview = document.getElementById('webview');
var indicator = document.querySelector('.indicator');
var loadstart = function() {
indicator.innerText = 'Loading...';
};
var loadstop = function() {
indicator.innerText = '';
};
var domready = function() {
fs.readFile(__dirname + '/style.css', 'utf8', function(error, data) {
webview.insertCSS(data);
});
fs.readFile(__dirname + '/webview.js', 'utf8', function(error, data) {
webview.executeJavaScript(data);
});
webview.openDevTools();
};
webview.addEventListener('did-start-loading', loadstart);
webview.addEventListener('did-stop-loading', loadstop);
webview.addEventListener('dom-ready', domready);
}
window.onload = run;
</script>
</head>
<body>
<webview id="webview" src="https://www.messenger.com">
<div class="indicator"></div>
</webview>
</body>
</html>