-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
42 lines (38 loc) · 1.36 KB
/
index.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
<html>
<head>
<title>MessengerImproved</title>
</head>
<body style="-webkit-app-region: drag">
<iframe style="width:100%;height:100%;border:0;padding:0;margin:0;" src="https://www.messenger.com/login" scrolling="no" nwdisable nwfaketop></iframe>
<script>
var frame = document.querySelector("iframe");
var nw = require('nw.gui');
frame.onload = function() {
// Override with default notifictions
frame.Notification = function(title, options) {
var n = new Notification(title, options);
n.onClick = function() {
nw.Window.get().focus();
};
};
// Modify to look like the small instance all the time
var mainel = frame.contentDocument.querySelector("div[role='main']");
var sidebar = mainel.previousSibling;
var banner = frame.contentDocument.querySelector("div[role='banner']");
// Make only head visible
sidebar.style.flexBasis = '74px';
sidebar.style.minWidth = '74px';
// Remove "messenger" text element
banner.removeChild(banner.children[1]);
// Make tekst invisible
var chatheads = frame.contentDocument.querySelectorAll('div[role=\'rowheader\']');
for (var i = 0; i < chatheads.length; i++) {
chatheads[i].children[0].children[1].style.display='none';
}
};
if(nw.App.filteredArgv.indexOf("--debug") !== -1){
nw.Window.get().showDevTools();
}
</script>
</body>
</html>