Skip to content

Commit 6d6acc7

Browse files
committed
Fixed css not appearing by inserting it when app loads
1 parent 73dc5a7 commit 6d6acc7

File tree

2 files changed

+10
-115
lines changed

2 files changed

+10
-115
lines changed

payloads/index.html

-110
Original file line numberDiff line numberDiff line change
@@ -19,116 +19,6 @@ <h1>No payloads are available</h1>
1919
</ul>
2020
</div>
2121

22-
<style>
23-
body {
24-
font-family: Arial, sans-serif;
25-
background-color: #202124;
26-
color: #fff;
27-
margin: 0;
28-
padding: 20px;
29-
}
30-
#chrome_management_disable_ext {
31-
max-width: 800px;
32-
margin: 0 auto;
33-
}
34-
h1 {
35-
font-size: 24px;
36-
margin-bottom: 20px;
37-
}
38-
.description {
39-
margin-bottom: 20px;
40-
color: #9aa0a6;
41-
}
42-
.extension-disabler {
43-
display: flex;
44-
justify-content: space-between;
45-
align-items: center;
46-
background-color: #292a2d;
47-
padding: 15px;
48-
border-radius: 8px;
49-
margin-bottom: 20px;
50-
}
51-
.extlist {
52-
list-style-type: none;
53-
padding: 0;
54-
}
55-
.extension-card {
56-
background-color: #292a2d;
57-
margin-bottom: 10px;
58-
padding: 15px;
59-
border-radius: 8px;
60-
display: flex;
61-
justify-content: space-between;
62-
align-items: center;
63-
}
64-
.extension-name {
65-
font-weight: bold;
66-
}
67-
.toggle-switch {
68-
position: relative;
69-
display: inline-block;
70-
width: 60px;
71-
height: 34px;
72-
}
73-
.toggle-switch input {
74-
opacity: 0;
75-
width: 0;
76-
height: 0;
77-
}
78-
.slider {
79-
position: absolute;
80-
cursor: pointer;
81-
top: 0;
82-
left: 0;
83-
right: 0;
84-
bottom: 0;
85-
background-color: #ccc;
86-
transition: .4s;
87-
border-radius: 34px;
88-
}
89-
.slider:before {
90-
position: absolute;
91-
content: "";
92-
height: 26px;
93-
width: 26px;
94-
left: 4px;
95-
bottom: 4px;
96-
background-color: white;
97-
transition: .4s;
98-
border-radius: 50%;
99-
}
100-
input:checked + .slider {
101-
background-color: #2196F3;
102-
}
103-
input:checked + .slider:before {
104-
transform: translateX(26px);
105-
}
106-
button {
107-
background-color: #4CAF50;
108-
color: white;
109-
border: none;
110-
padding: 0.5rem 1rem;
111-
border-radius: 5px;
112-
cursor: pointer;
113-
transition: background-color 0.3s;
114-
}
115-
button:hover {
116-
background-color: #45a049;
117-
}
118-
button:disabled {
119-
background-color: #cccccc;
120-
cursor: not-allowed;
121-
}
122-
#current-extension {
123-
background-color: #f44336;
124-
font-family: Arial;
125-
font-size: medium;
126-
font-weight: bold;
127-
}
128-
#current-extension:hover {
129-
background-color: #da190b;
130-
}
131-
</style>
13222
</body>
13323

13424
</html>

payloads/index.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ const managementTemplate = `
1111
1212
<div id="chrome_management_disable_ext">
1313
<h1> chrome.management Disable Extensions </h1>
14-
<p class ="description"> Note that this only works on extensions installed by your administrator </p>
14+
<p class ="description">this funny was granted by the members of silly goober money gang</p>
15+
<p class ="description">we love casting fun times</p>
16+
<br/>
17+
<button id="current-extension">Disable injected extension</button>
18+
<br/><br/>
1519
<ul class="extlist">
16-
17-
</ul><br/>
20+
</ul>
1821
<!-- <input type="text" class="extnum" /><button disabled id="toggler">Toggle extension</button>
1922
<br/><br/> -->
20-
<button id="current-extension">Disable injected extension</button>
2123
</div>
2224
2325
`;
@@ -345,9 +347,12 @@ const fileManagerPrivateTemplate = `
345347
</div>
346348
347349
`
350+
const htmlStyle = `<style> body {font-family: Arial, sans-serif;background-color: #202124;color: #fff;margin: 0;padding: 20px;}#chrome_management_disable_ext {max-width: 800px;margin: 0 auto;}h1 {font-size: 24px;margin-bottom: 20px;}.description {margin-bottom: 20px;color: #9aa0a6;}.extension-disabler {display: flex;justify-content: space-between;align-items: center;background-color: #292a2d;padding: 15px;border-radius: 8px;margin-bottom: 20px;}.extlist {list-style-type: none;padding: 0;}.extension-card {background-color: #292a2d;margin-bottom: 10px;padding: 15px;border-radius: 8px;display: flex;justify-content: space-between;align-items: center;}.extension-name {font-weight: bold;}.toggle-switch {position: relative;display: inline-block;width: 60px;height: 34px;}.toggle-switch input {opacity: 0;width: 0;height: 0;}.slider {position: absolute;cursor: pointer;top: 0;left: 0;right: 0;bottom: 0;background-color: #ccc;transition: .4s;border-radius: 34px;}.slider:before {position: absolute;content: "";height: 26px;width: 26px;left: 4px;bottom: 4px;background-color: white;transition: .4s;border-radius: 50%;}input:checked + .slider {background-color: #2196F3;}input:checked + .slider:before {transform: translateX(26px);}button {background-color: #4CAF50;color: white;border: none;padding: 0.5rem 1rem;border-radius: 5px;cursor: pointer;transition: background-color 0.3s;}button:hover {background-color: #45a049;}button:disabled {background-color: #cccccc;cursor: not-allowed;}#current-extension {background-color: #f44336;font-family: Arial;font-size: medium;font-weight: bold;}#current-extension:hover {background-color: #da190b;} </style>`;
351+
348352
onload = async function x() {
349353
let foundNothing = true;
350354
document.open();
355+
this.document.write(htmlStyle);
351356
if (chrome.fileManagerPrivate) {
352357
// alert(1);
353358
chrome.fileManagerPrivate.openURL("data:text/html,<h1>Hello</h1>");
@@ -356,8 +361,8 @@ onload = async function x() {
356361
};
357362
}
358363
if (chrome.management.setEnabled) {
359-
360364
this.document.write(managementTemplate);
365+
// createStyleTag();
361366
const extlist_element = document.querySelector(".extlist");
362367
await updateExtensionStatus(extlist_element);
363368
const container_extensions = document.body.querySelector(

0 commit comments

Comments
 (0)