Clean repo/README.md, add option to disable extension and bump version to 2.

This commit is contained in:
天クマ 2026-04-25 17:22:46 -03:00
commit 9dc35139d6
7 changed files with 123 additions and 57 deletions

89
menu/main.css Normal file
View file

@ -0,0 +1,89 @@
:root {
--accent: orangered;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: black;
color: white;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
padding: 1em;
}
a {
color: var(--accent);
text-decoration: none;
}
a:hover {
color: white;
}
body::before {
content: "";
background-image: url(/img/mango-full.jpg);
position: absolute;
background-size: cover;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: -1;
opacity: .25;
}
textarea {
outline: medium solid transparent;
transition: .4s;
background-color: black;
margin-bottom: 10px;
color: white;
border: thin solid white;
padding: .4em;
}
textarea:focus {
outline-color: var(--accent);
}
h1 {
font-weight: 300;
font-size: 3em;
margin: 0;
}
h2 {
margin-bottom: .4em;
}
button {
transition: .2s;
border: 1px solid white;
background-color: black;
color: white;
font-size: large;
padding: .2em;
}
button:hover {
background-color: white;
color: black;
}
h2 {
font-weight: 300;
margin-top: 0;
}
footer {
margin-top: 1em;
}
#version {
opacity: .6;
}

33
menu/main.js Normal file
View file

@ -0,0 +1,33 @@
let enabled = true;
const toggleButton = document.getElementById("toggle");
updateButtonText();
function updateButtonText() {
toggleButton.textContent = enabled ? "disable" : "enable";
}
document.getElementById('whitelistSave').addEventListener('click', () => {
const whitelist = document.getElementById('whitelist').value.split('\n').map(line => line.trim()).filter(line => line);
browser.storage.local.set({ whitelist: whitelist });
});
browser.storage.local.get("enabled").then((result) => {
enabled = result.enabled ?? true;
updateButtonText();
}).catch((error) => {
console.error("Error retrieving enabled state:", error);
});
browser.storage.local.get("whitelist").then((result) => {
const whitelist = result.whitelist || [];
document.getElementById('whitelist').value = whitelist.join('\n');
}).catch((error) => {
console.error("Error retrieving the whitelist:", error);
});
toggleButton.addEventListener('click', () => {
enabled = !enabled;
updateButtonText();
browser.storage.local.set({enabled: enabled});
})