-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.js
More file actions
36 lines (29 loc) · 1003 Bytes
/
Copy pathcontent.js
File metadata and controls
36 lines (29 loc) · 1003 Bytes
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
function createTaskbar() {
const taskbar = document.createElement("div");
taskbar.id = "fake-taskbar";
taskbar.innerHTML = `
<div class="taskbar-left">
<button class="nav-btn" onclick="history.back()">←</button>
<button class="nav-btn" onclick="history.forward()">→</button>
<button class="nav-btn" onclick="location.reload()">⟳</button>
</div>
<div class="taskbar-right">
<button class="exit-btn" onclick="document.getElementById('fake-taskbar').remove()">Exit</button>
</div>
`;
document.body.appendChild(taskbar);
// Adjust body content to be pushed down
document.body.style.marginTop = '86px';
}
chrome.runtime.onMessage.addListener((message) => {
if (message.action === "toggle_taskbar") {
const existing = document.getElementById("fake-taskbar");
if (existing) {
existing.remove();
document.body.style.marginTop = '70px';
} else {
createTaskbar();
}
}
});
createTaskbar(); // Initial render