-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
66 lines (62 loc) · 2.1 KB
/
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
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
62
63
64
65
66
var enabled;
chrome.storage.local.get(['skipEnabled', 'stealthEnabled', 'background'], function (result) {
console.log(result.skipEnabled);
console.log(result.stealthEnabled);
enabled = result.skipEnabled;
stealth = result.stealthEnabled;
document.getElementById("backgroundInput").value = result.background;
if (enabled == true) {
document.getElementById("active").innerText = "Echo Test Skip is Enabled";
document.getElementById("toggle").innerText = "Disable";
document.getElementById("toggle").style.background = "#cc2929";
document.getElementById("toggle").style.borderColor = "#a62323";
document.getElementById("colorBar").style.background = "#29cc41";
} else {
document.getElementById("active").innerText = "Echo Test Skip is Disabled";
document.getElementById("toggle").innerText = "Enable";
document.getElementById("toggle").style.background = "#29cc41";
document.getElementById("toggle").style.borderColor = "#23a636";
document.getElementById("colorBar").style.background = "#cc2929";
}
if(stealth){
document.getElementById("stealth").innerText = "Disable Stealth Mode";
} else {
document.getElementById("stealth").innerText = "Enable Stealth Mode";
}
});
document.getElementById("toggle").addEventListener("click", toggleActive);
document.getElementById("stealth").addEventListener("click", stealthActive);
document.getElementById("backgroundInput").addEventListener("input", updateBackground);
function toggleActive() {
if (enabled == true) {
chrome.storage.local.set({
'skipEnabled': false
}, function () {
window.location.reload();
});
} else {
chrome.storage.local.set({
'skipEnabled': true
}, function () {
window.location.reload();
});
}
}
function stealthActive() {
if (stealth == true) {
chrome.storage.local.set({
'stealthEnabled': false
}, function () {
window.location.reload();
});
} else {
chrome.storage.local.set({
'stealthEnabled': true
}, function () {
window.location.reload();
});
}
}
function updateBackground(){
chrome.storage.local.set({'background': document.getElementById("backgroundInput").value}, function () {});
}