-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (38 loc) · 1.41 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
43
44
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
html, body {
}
</style>
<script>
var ExtensionID = "";
var twitchToken = "none";
function messageExtention() {
chrome.runtime.sendMessage(ExtensionID, {requestType: "setTtvToken", ttvToken: getHashParameters("access_token")},
function(response) {
if (response.status == "success") {
document.getElementById("mainMessage").innerHTML = "Logged in successfully! You can close this tab now.";
} else {
document.getElementById("mainMessage").innerText = "An issue occured!<br />(" + response.status + ")";
}
})
}
function getHashParameters(hashname) {
var hashParams = new Map();
window.location.hash.substr(1).split('&').forEach(function(element) {
let newElem = element.split('=');
hashParams.set(newElem[0], newElem[1]);
})
return (hashParams.get(hashname));
}
window.addEventListener("load", function() {
messageExtention();
});
</script>
</head>
<body>
<div id="mainMessage">Please wait a few seconds...</div>
</body>
</html>