-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.js
26 lines (21 loc) · 789 Bytes
/
popup.js
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
chrome.runtime.sendMessage({executeFn: "getSignedInUser"}, (response) => {
document.getElementById("username").innerHTML = response.profile.upn;
});
/**
* Sign in button
*/
document.getElementById("sign-in").addEventListener("click", () => {
chrome.runtime.sendMessage({executeFn: "signIn"}, (response) => {
document.getElementById("username").innerHTML = response.profile.upn;
});
});
/**
* Sign out button
*/
document.getElementById("sign-out").addEventListener("click", () => {
document.getElementById("username").innerHTML = "";
document.getElementById("displayname").innerHTML = "";
chrome.runtime.sendMessage({executeFn: "signOut"}, (response) => {
document.getElementById("username").innerHTML = response.profile.upn;
});
});