-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.js
More file actions
40 lines (31 loc) · 1.22 KB
/
init.js
File metadata and controls
40 lines (31 loc) · 1.22 KB
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
window.onload = function () {
chrome.storage.local.get(['devMode', 'notif', 'playSound'], function (result) {
if (result.playSound == null) {
chrome.storage.local.set({'playSound': true}, function () {
});
}
if (result.notif == null) {
chrome.storage.local.set({'notif': true}, function () {
});
}
if (result.devMode == null) {
chrome.storage.local.set({'devMode': false}, function () {
});
}
});
};
let tickRate = 60 * 1000; // time update = 60sec
let notif = new Audio("/assets/sounds/notif.mp3"); // audio for notification
notif.volume = 1; // volume of notification
let stream = []; // init array for stream info
if ((typeof stream.notified) == "undefined") {
stream.notified = false;
}
stream.urlApi = "https://api.twitch.tv/kraken/streams/186509013"; // Squntt_
stream.ClientID = "98pfvdmm2imwdl4qe2gdqp35cth9m4";
let notificationConf = [];
notificationConf.imageUrl = '/assets/images/notifPaperwall.png';
notificationConf.iconUrl = '/assets/icons/squntt_icon48.png';
notificationConf.title = "Squntt_ live !";
notificationConf.message = "Je stream !";
let streamer = []; // init var usable for api