Compare commits
No commits in common. "master" and "2.0" have entirely different histories.
10 changed files with 92 additions and 160 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
mango.zip
|
|
||||||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 Adrian Victor
|
Copyright (c) 2024 adrianvictor
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
|
|
||||||
23
README.MD
23
README.MD
|
|
@ -1,20 +1,17 @@
|
||||||
# Mango
|
# Mango
|
||||||
I declare war to rouded corners!
|
Obliterates rounded corners... BECAUSE I HATE THEM
|
||||||
|
|
||||||
<a href="https://addons.mozilla.org/en-US/firefox/addon/mangocorners/"><img src="./img/Firefox-badges.jpg" alt="Firefox Addon Store Icon" width="200"/></a>
|
<img src="https://addons.mozilla.org/user-media/previews/full/307/307501.png?modified=1729803414" alt="Mango configuration UI" width="200"/>
|
||||||
|
<img src="https://addons.mozilla.org/user-media/previews/full/307/307505.png?modified=1729803420" alt="Mango VS YouTube default design" width="400"/>
|
||||||
## Example
|
|
||||||
<img src="https://addons.mozilla.org/user-media/previews/full/307/307505.png?modified=1729803420" alt="Mango VS YouTube default design"/>
|
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
```css
|
``* {
|
||||||
* {
|
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}``
|
||||||
```
|
That's everything we inject into your page, feel free to check the source code to be sure we're not doing anything malicious.
|
||||||
This CSS tells your browser that everything (`*`) should have the property `border-radius` (amount of rounded corner) to 0.
|
|
||||||
|
|
||||||
The extension just injects this into your page after checking if the page is whitelisted. This extension is so tiny that you can review `mango.js` and `main.js` by yourself or with help of AI.
|
## Why 'Mango'
|
||||||
|
Mango is the codename of the first Windows Phone OS to have a codename (Windows Phone 7.5). I had a WP as a child and I always loved the "minimalist square" design of Windows Phone.
|
||||||
|
|
||||||
## Why Mango
|
## Contributing
|
||||||
Mango is the codename of _Windows Phone 7.5_, the first version to adopt Microslop's "Metro UI". I grew up as a kid using Windows Phone and that shaped the way I see rounded corners—and I absolutely hate them.
|
Just do a pull request
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.7 KiB |
15
mango.html
15
mango.html
|
|
@ -1,20 +1,17 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Mango</title>
|
<title>Mango</title>
|
||||||
<script src="menu/main.js" defer></script>
|
<script src="mangoui.js" defer></script>
|
||||||
<link rel="stylesheet" href="menu/main.css">
|
<link rel="stylesheet" href="mangoUI.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="title">mango</h1>
|
<h1 id="title">mango</h1>
|
||||||
<h2 id="source">whitelist</h2>
|
<h2 id="source">whitelist</h2>
|
||||||
<textarea placeholder="Domain only, separated by new line, see the example:
|
<textarea placeholder="Domain only, separated by new line, see the example:
|
||||||
example.com
|
example.com
|
||||||
example2.com" id="whitelist" rows="10" cols="30"></textarea><br>
|
example2.com" id="whitelist" rows="10" cols="30"></textarea><br>
|
||||||
<button id="whitelistSave">save</button>
|
<button id="whitelistSave">save</button>
|
||||||
<button id="toggle">enabled</button>
|
<p><a href="https://git.disroot.org/adrianvictor/mango">source-code</a></p>
|
||||||
<footer>
|
|
||||||
<p><span id="version">v3</span> Adrian Victor <a href="https://github.com/adrianvic/mango">(source-code)</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
45
mango.js
45
mango.js
|
|
@ -1,31 +1,26 @@
|
||||||
const currentHostname = location.hostname;
|
console.log("[Mango] Let's get the business done.")
|
||||||
let enabled = true;
|
|
||||||
|
|
||||||
browser.storage.local.get("enabled").then((result) => {
|
|
||||||
enabled = result.enabled ?? true;
|
|
||||||
}).catch((error) => {
|
|
||||||
console.error("Error retrieving enabled state:", error);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function checkWhitelist(url) {
|
function checkWhitelist(url) {
|
||||||
return browser.storage.local.get("whitelist").then((result) => {
|
return browser.storage.local.get("whitelist").then((result) => {
|
||||||
const whitelist = result.whitelist || [];
|
const whitelist = result.whitelist || [];
|
||||||
return whitelist.includes(url);
|
return whitelist.includes(url);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
checkWhitelist(currentHostname).then((isWhitelisted) => {
|
const currentHostname = location.hostname;
|
||||||
if (!isWhitelisted && enabled) {
|
|
||||||
const styles = `
|
checkWhitelist(currentHostname).then((isWhitelisted) => {
|
||||||
|
if (!isWhitelisted) {
|
||||||
|
const styles = `
|
||||||
* {
|
* {
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
const injectedStyle = document.createElement("style");
|
const injectedStyle = document.createElement("style");
|
||||||
injectedStyle.type = "text/css";
|
injectedStyle.type = "text/css";
|
||||||
injectedStyle.id = "mangoInjectedStyle";
|
injectedStyle.innerText = styles;
|
||||||
injectedStyle.innerText = styles;
|
document.head.appendChild(injectedStyle);
|
||||||
document.head.appendChild(injectedStyle);
|
} else {
|
||||||
}
|
console.log("[Mango] Mercy! This page is whitelisted.")
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,11 @@
|
||||||
:root {
|
|
||||||
--accent: orangered;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
padding: 1em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: var(--accent);
|
color: orangered;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -37,53 +26,26 @@ body::before {
|
||||||
opacity: .25;
|
opacity: .25;
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
#whitelist {
|
||||||
outline: medium solid transparent;
|
|
||||||
transition: .4s;
|
|
||||||
background-color: black;
|
background-color: black;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
color: white;
|
color: white;
|
||||||
border: thin solid white;
|
|
||||||
padding: .4em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea:focus {
|
#title {
|
||||||
outline-color: var(--accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
font-size: 3em;
|
font-size: 50px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
#whitelistSave {
|
||||||
margin-bottom: .4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
transition: .2s;
|
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
font-size: large;
|
font-size: large;
|
||||||
padding: .2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
|
||||||
background-color: white;
|
|
||||||
color: black;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
|
||||||
margin-top: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#version {
|
|
||||||
opacity: .6;
|
|
||||||
}
|
|
||||||
14
mangoui.js
Normal file
14
mangoui.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
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 });
|
||||||
|
console.log('Whitelist saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
@ -1,39 +1,40 @@
|
||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Mango",
|
"name": "Mango",
|
||||||
"version": "3.0",
|
"version": "1.0",
|
||||||
"description": "Obliterates rounded corners.",
|
"description": "Obliterates rounded corners.",
|
||||||
|
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "img/mango-48.jpg",
|
"48": "img/mango-48.jpg",
|
||||||
"96": "img/mango-96.jpg"
|
"96": "img/mango-96.jpg"
|
||||||
},
|
},
|
||||||
|
|
||||||
"default_icon": {
|
"default_icon": {
|
||||||
"96": "img/mango-96.jpg"
|
"96": "img/mango-96.jpg"
|
||||||
},
|
},
|
||||||
|
|
||||||
"browser_specific_settings": {
|
"browser_specific_settings": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "adrianvictor.mango@disroot.org"
|
"id": "adrianvictor.mango@disroot.org"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
"default_icon": "img/mango-96.jpg",
|
"default_icon": "img/mango-96.jpg",
|
||||||
"default_title": "Mango",
|
"default_title": "Mango",
|
||||||
"default_popup": "mango.html"
|
"default_popup": "mango.html"
|
||||||
},
|
},
|
||||||
|
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage",
|
"storage",
|
||||||
"activeTab"
|
"activeTab"
|
||||||
],
|
],
|
||||||
|
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
"matches": ["<all_urls>"],
|
"matches": ["<all_urls>"],
|
||||||
"js": ["mango.js"]
|
"js": ["mango.js"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
33
menu/main.js
33
menu/main.js
|
|
@ -1,33 +0,0 @@
|
||||||
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});
|
|
||||||
})
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue