Add files via upload

This commit is contained in:
DeBros 2025-02-09 17:58:17 +02:00 committed by GitHub
commit 1ee06a5f6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 1413 additions and 0 deletions

174
README.md Normal file
View File

@ -0,0 +1,174 @@
# ANyONe Extension - Manage Socks5 Proxy Settings
## Overview
The ANyONe Proxy Extension is a powerful Chromium-based browser extension designed to help users manage and switch between different proxy settings effortlessly. It offers quick access through the browser's toolbar and detailed control via an options page. Additionally, the extension features a dApp Store, enabling users to access decentralized applications directly from the extension, ensuring secure and private browsing. This extension was created by DeBros and is not an official product from ANyONe; it's a community-driven project.
##
<p align="center">
<img src="https://github.com/DeBrosOfficial/ANyONe-Extension/blob/main/images/screenshot.jpg" alt="Alt Text" width="800">
</p>
## Features
### 1. Quick Proxy Toggle
- **Enable/Disable Proxy**: A toggle switch in the popup allows users to quickly turn the proxy on or off.
- **Public Proxies**:
- **Default Activation**: Automatically uses community-contributed public proxy servers when no custom settings are applied.
- **Dynamic List**: Easily update the proxy list with a dedicated button within the extension.
### 2. Custom Proxy Settings via Options Page
- **Access Custom Settings**: Users can configure custom proxies by navigating to the options page.
- **Host and Port**: Specify the host IP and port number for your custom proxy.
- **No Proxy Exceptions**: Define specific websites or local addresses where the proxy should not be applied.
- **Detailed Configuration**: The options page allows for:
- Setting up custom proxy configurations.
- Managing exceptions to proxy use.
- Saving and applying changes for a tailored browsing experience.
### 3. Proxy Status Indication
- **Status Messages**: The extension provides clear feedback on the current proxy status both in the popup and options page, including:
- Whether a proxy is enabled or disabled.
- The type of proxy in use (public or custom).
- The specific host and port being routed through.
### 4. External Links
- **Check ANyONe**: A button to directly check the external IP and proxy status via the ANyONe service.
- **Credits**: Links to the developer's website and the GitHub repository for the extension.
- **Popup**: Links to the developer's website, X account, GitHub repository for the extension, and ANyONe website.
## Usage
### Enabling/Disabling Proxy
- Click the extension icon to open the popup.
- Use the toggle switch to enable or disable the proxy.
- The status message will update to reflect the current state.
### Public Proxies:
- **Default Usage**: When no custom settings are specified, the extension automatically uses public proxy servers, which are contributed and maintained by the ANyONe community.
- **Update Mechanism**: You can easily refresh the proxy list directly within the extension using an update button.
- **View Proxies**: To see the current list of community-powered public proxies, visit [https://github.com/DeBrosOfficial/ANyONe-Proxy-List](https://github.com/DeBrosOfficial/ANyONe-Proxy-List).
### Setting a Custom Proxy
- Navigate to the options page by clicking the "Custom Settings" button in the popup.
- Enter the Host IP and Port for your custom proxy.
- Optionally, specify IP addresses or domains that should bypass the proxy in the "No Proxy for" field.
- Click "Save & Enable" to apply your settings.
### Disabling the Proxy
- From the options page, click "Disable" to turn off the proxy settings, or from the popup, turn the toggle off.
### Accessing the dApp Store
- Click the "dApp Store" button in the popup to open the dApp Store page.
- The dApp Store page will display available decentralized applications.
## Installation
### 1. Clone or Download the Repository
You have two options to get the extension on your system:
- **Option A: Clone with Git**
```bash
git clone "https://github.com/DeBrosOfficial/ANyONe-Extension.git"
```
- **Option B: [Download ZIP](https://github.com/DeBrosOfficial/ANyONe-Extension/archive/refs/heads/main.zip)**
### 2. Load Unpacked Extension in Chromium-based Browser
- Open your browser and navigate to the extensions page.
- Enable "Developer mode".
- Depending on your method in step 1:
- If you cloned the repository, click "Load unpacked" and select the cloned directory containing the `manifest.json` file.
- If you downloaded and unpacked, drag and drop the unpacked folder into the extensions window.
## Contribution
Contributions are welcome! Please fork the repository and submit pull requests for any enhancements or bug fixes.
For questions or further discussion, reach out to us on <a href="https://t.me/debrosportal" target="_blank">Telegram</a>
---
# Optional: Enhancing Security with Custom DNS Configuration
Manually configuring your network's DNS can significantly boost your online privacy and security. Below, you'll find a selection of well-regarded, secure DNS servers that provide enhanced protection and privacy features:
## Cloudflare DNS (1.1.1.1)
- **IPv4**: 1.1.1.1 and 1.0.0.1
- **IPv6**: 2606:4700:4700::1111 and 2606:4700:4700::1001
- **Features**: Fast performance, does not log DNS queries, supports DNS over HTTPS (DoH) and DNS over TLS (DoT).
- **Website**: [https://1.1.1.1/dns](https://1.1.1.1/dns)
## Quad9 (9.9.9.9)
- **IPv4**: 9.9.9.9 and 149.112.112.112
- **IPv6**: 2620:fe::9 and 2620:fe::fe:9
- **Features**: Offers protection against malware and phishing, privacy with no logging of DNS queries. Supports DoT.
- **Website**: [https://quad9.net](https://quad9.net)
## Mullvad DNS
- **IPv4**: 194.242.2.1 and 194.242.2.2
- **IPv6**: 2a07:e340::1 and 2a07:e340::2
- **Features**: Complete privacy with no logging, supports DoH and DoT. Ideal for users concerned with anonymity.
- **Website**: [https://mullvad.net/en](https://mullvad.net/en)
## AdGuard DNS
- **IPv4**: 94.140.14.14 and 94.140.15.15 (without filters), 176.103.130.130 and 176.103.130.131 (with filters)
- **IPv6**: 2a10:50c0::ad1:ff and 2a10:50c0::ad2:ff (without filters), 2a10:50c0::bad1:ff and 2a10:50c0::bad2:ff (with filters)
- **Features**: Provides protection against ads, trackers, and phishing, as well as privacy with no logging.
- **Website**: [https://adguard-dns.io](https://adguard-dns.io)
## How to Configure:
- **For Windows**: Go to "Settings" > "Network & Internet" > "Change adapter options", right-click on your connection, select "Properties", then select "Internet Protocol Version 4 (TCP/IPv4)" or "Internet Protocol Version 6 (TCP/IPv6)" and enter the DNS addresses you want.
- **For macOS**: Navigate to "System Preferences" > "Network", select your connection, click on the "Advanced" button, go to the "DNS" tab, and add your DNS addresses.
- **For Linux**: Depending on the distribution, you can usually modify the `/etc/resolv.conf` file to add DNS addresses.
- **For Routers**: You'll typically find DNS settings in the advanced settings of your router. This will change the DNS for all devices connected to the network.
---
# ANyONe Protocol: Connection and Setup Guide
**About ANyONe Protocol**: ANyONe is a decentralized network protocol focused on providing privacy, security, and freedom on the internet. Whether you're looking to browse anonymously or secure your online communications, ANyONe offers versatile solutions for different needs.
Explore multiple ways to interact with the ANyONe, whether you're connecting directly from your OS, setting up your own relay for personalized control, or using dedicated hardware for an optimized experience. Here's your guide:
- **Linux**: Enjoy a seamless one-click setup. Learn more in the [Linux Connection Guide](https://docs.anyone.io/connect/connecting-to-linux).
- **macOS**: Connect easily with or without npm. Check the [macOS Connection Guide](https://docs.anyone.io/connect/connecting-to-macos).
- **Windows**: Benefit from a straightforward one-click setup. See the [Windows Connection Guide](https://docs.anyone.io/connect/connecting-to-windows).
**Setting Up Your Own Relay**: For those interested in customizing your network participation or contributing to the ANyONe ecosystem, follow the [Relay Setup Guide](https://docs.anyone.io/relay).
**Dedicated Hardware**: For a user-friendly, plug-and-play experience, ANyONe offers specialized hardware like the Anyone Router. This hardware is designed for non-technical users to contribute to and use the network seamlessly, offering:
- **Ease of Use**: Power on, connect to Wi-Fi or Ethernet, and earn tokens for contributing your bandwidth.
- **Security**: Includes custom components like encryption chips similar to those in hardware wallets.
- **Diversity**: Enhances network coverage across various ISPs and introduces more independent operators.
Check out the [Hardware Setup Guide](https://docs.anyone.io/hardware) or visit [Anyone Hardware](https://www.anyone.io/hardware) to learn more and pre-order.
---
###
<br clear="both">
<div align="center">
<a href="https://linktr.ee/debrosofficial" target="_blank">
<img src="https://img.shields.io/static/v1?message=Linktree&logo=linktree&label=&color=1de9b6&logoColor=white&labelColor=&style=for-the-badge" height="35" alt="linktree logo" />
</a>
<a href="https://x.com/debrosofficial" target="_blank">
<img src="https://img.shields.io/static/v1?message=Twitter&logo=twitter&label=&color=1DA1F2&logoColor=white&labelColor=&style=for-the-badge" height="35" alt="twitter logo" />
</a>
<a href="https://t.me/debrosportal" target="_blank">
<img src="https://img.shields.io/static/v1?message=Telegram&logo=telegram&label=&color=2CA5E0&logoColor=white&labelColor=&style=for-the-badge" height="35" alt="telegram logo" />
</a>
<a href="https://www.youtube.com/@DeBrosOfficial" target="_blank">
<img src="https://img.shields.io/static/v1?message=Youtube&logo=youtube&label=&color=FF0000&logoColor=white&labelColor=&style=for-the-badge" height="35" alt="youtube logo" />
</a>
</div>
###

253
html/options.html Normal file
View File

@ -0,0 +1,253 @@
<!DOCTYPE html>
<html>
<head>
<title>Proxy Settings</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0px;
text-align: center;
color: #ffffff;
width: auto;
background-image: url('../images/optionsback.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
min-height: 100vh;
overflow-y: hidden;
}
h1 {
margin-top: 20px;
}
.container {
max-width: 400px;
margin: 50px auto;
padding-top: 10px;
padding-bottom: 1px;
padding-left: 0px;
padding-right: 0px;
background-color: rgba(0, 0, 0, 0.6);
border-radius: 10px;
}
.form-group {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
label {
display: inline-block;
margin-bottom: 10px;
margin-top: 20px;
margin-left: 5px;
font-weight: bold;
white-space: nowrap;
color: #ecf0f1;
}
select, input {
width: 130px;
padding: 5px;
margin: 0;
border-radius: 5px;
border: 1px solid black;
font-size: 14px;
color: black;
background-color: #ecf0f1;
}
#proxyPort {
width: 60px;
}
.no-proxy-group {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin:20px;
}
.no-proxy-group label {
margin-bottom: 0;
margin-top: 0;
margin-right: 2px;
}
#noProxyFor {
width: 75%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
padding: 5px;
margin: 0 auto;
border-radius: 5px;
border: 1px solid black;
font-size: 14px;
color: black;
background-color: #ecf0f1;
display: block;
max-width: 100%;
}
button {
padding: 7px 3px;
margin: 10px 0px;
border: 1px solid black;
border-radius: 5px;
background-color: #ecf0f1;
color: black;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease;
display: inline-block;
}
button:hover {
background-color: #2ecc71;
}
.container button#disableProxy:hover {
background-color: #e74c3c;
}
.container button#checkAnyoneButton:hover {
background-color: #00ced1;
}
.container .button-group {
display: flex;
justify-content: center;
gap: 10px;
margin-top: 10px;
}
.container .button-group button {
display: inline-block;
}
.credits {
margin-top: 10px;
margin-bottom: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
.credits-link {
text-decoration: none;
color: inherit;
display: flex;
align-items: center;
margin-bottom: 10px;
transition: all 0.3s ease;
}
.credits-link:hover {
opacity: 0.8;
transform: translateY(-2px);
color: #2ecc71;
}
.credits-link span {
font-size: 14px;
font-weight: bold;
transition: color 0.1s ease;
}
.credits img {
margin-right: 10px;
transition: transform 0.3s ease;
}
.credits-link:hover img {
transform: scale(1.1);
}
#anonLogo {
margin: 20px auto 10px;
display: block;
}
#statusMessage {
height: 40px;
margin: 10px 0;
text-align: center;
padding: 0 20px;
}
@media (max-width: 600px) {
.container {
width: 90%;
margin: 0 auto;
}
select, input, button {
width: 100%;
}
.form-group {
flex-direction: column;
align-items: flex-start;
}
label {
margin-bottom: 5px;
}
.button-group {
flex-direction: row;
}
.credits {
align-items: flex-start;
}
.no-proxy-group label {
width: 100%;
}
#noProxyFor {
width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<img src="../images/anonlogo.png" alt="AnON Logo" width="120" height="120" id="anonLogo">
<h1>My Socks5 Proxy Settings</h1>
<label for="proxyIP">
Host
<input type="text" id="proxyIP" placeholder="enter host">
</label>
<label for="proxyPort">
Port
<input type="number" id="proxyPort" placeholder="port">
</label>
<div class="no-proxy-group">
<label for="noProxyFor">No Proxy for</label>
<input type="text" id="noProxyFor" placeholder="e.g., localhost, *.example.com" name="noProxyFor">
</div>
<div class="button-group">
<button id="saveSettings">Save & Enable</button>
<button id="disableProxy">Disable</button>
<button id="checkAnyoneButton">Check ANyONe</button>
</div>
<p id="statusMessage"></p>
<div class="credits">
<a href="https://debros.io" target="_blank" rel="noopener noreferrer" class="credits-link" aria-label="Visit DeBros website">
<img src="../images/debroslogo.png" alt="DeBros Logo" width="30" height="30">
<span>This extension was created by DeBros</span>
</a>
<a href="https://github.com/DeBrosOfficial/ANyONe-Extension" target="_blank" rel="noopener noreferrer" class="credits-link" aria-label="Explore the open source code and documentation">
<span>It's open source - explore the code and docs here</span>
</a>
</div>
</div>
<script src="../js/options.js"></script>
</body>
</html>

217
html/popup.html Normal file
View File

@ -0,0 +1,217 @@
<!DOCTYPE html>
<html>
<head>
<title>ANyONe Network Gateway</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
padding: 10px 30px 10px;
background-image: url('../images/popupback.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-color: #6d8392;
color: white;
text-align: center;
width: 220px;
height: 500px;
overflow: hidden;
}
#anonLogo {
margin: 10px auto 10px;
display: block;
}
.switch {
position: relative;
display: inline-block;
width: 50px;
height: 15px;
}
.switch input {
opacity: 1;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #e74c3c;
transition: 0.4s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 25px;
width: 25px;
left: 0px;
bottom: -4px;
background-color: #ffffff;
transition: 0.4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #02af50;
}
input:checked + .slider:before {
transform: translateX(26px);
}
#statusMessage {
margin-top: 30px;
font-size: 18px;
font-weight: none;
min-height: 30px;
}
.button-container-1 {
margin-top: 10px;
margin-bottom: 5px;
display: flex;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
position: absolute;
bottom: 140px;
left: 0;
right: 0;
}
.button-container-2 {
margin-top: 10px;
margin-bottom: 20px;
display: flex;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
position: absolute;
bottom: 65px;
left: 0;
right: 0;
}
button {
color: white;
padding: 5px 15px;
font-size: 14px;
font-weight: normal;
border-radius: 5px;
cursor: pointer;
margin: 0 5px;
width: 100px;
height: auto;
box-sizing: border-box;
text-align: center;
white-space: normal;
overflow: visible;
display: inline-flex;
flex-direction: column;
justify-content: center;
}
#checkAnyoneButton {
background-color: #0280AF;
border: 1px solid #0280AF;
}
#checkAnyoneButton:hover {
background-color: #0074f0;
}
#updateProxiesButton {
background-color: #0a121e;
border: 1px solid #0280AF;
}
#updateProxiesButton:hover {
background-color: #0280AF;
}
#optionsButton {
background-color: #0a121e;
border: 1px solid #03bdc5;
}
#optionsButton:hover {
background-color: #03bdc5;
}
#dappStoreButton {
background-color: #0a121e;
border: 1px solid #03bdc5;
}
#dappStoreButton:hover {
background-color: #03bdc5;
}
.footer {
position: absolute;
bottom: 0px;
left: 0;
right: 0;
display: flex;
justify-content: center;
gap: 30px;
}
.social-link {
display: block;
width: 30px;
height: 30px;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
margin-top: 10px;
margin-bottom: 30px;
}
.social-link.debros { background-image: url('../images/debroslogo.png'); }
.social-link.x { background-image: url('../images/x.png'); }
.social-link.docs { background-image: url('../images/github.png'); }
.social-link.anyone { background-image: url('../images/anonlogo.png'); }
</style>
</head>
<body>
<img src="../images/anonlogo.png" alt="AnON Logo" width="120" height="120" id="anonLogo">
<h1>ANyONe Proxy</h1>
<label class="switch">
<input type="checkbox" id="proxyToggle">
<span class="slider"></span>
</label>
<p id="statusMessage"></p>
<div class="button-container-1">
<button id="checkAnyoneButton">Check ANyONe</button>
<button id="updateProxiesButton">Update Proxies</button>
</div>
<div class="button-container-2">
<button id="optionsButton">Custom Settings</button>
<button id="dappStoreButton">dApp Store</button>
</div>
<div class="footer">
<a href="https://debros.io" class="social-link debros" target="_blank"></a>
<a href="https://x.com/debrosofficial" class="social-link x" target="_blank"></a>
<a href="https://github.com/DeBrosOfficial/ANyONe-Extension" class="social-link docs" target="_blank"></a>
<a href="https://anyone.io" class="social-link anyone" target="_blank"></a>
</div>
<script src="../js/popup.js"></script>
</body>
</html>

46
html/store.html Normal file
View File

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<title>dApp Store</title>
<style>
body, html {
height: 100%;
margin: 0;
padding: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
background-color: black;
font-family: Arial, Helvetica, sans-serif;
}
#fullScreenImage {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: -1;
opacity: 0;
transition: opacity 2s ease-in-out;
}
#comingSoon {
font-size: 3em;
color: white;
opacity: 0;
transition: opacity 2s ease-in-out;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
</style>
</head>
<body>
<img id="fullScreenImage" src="../images/comingsoon.png" alt="Coming Soon Background">
<div id="comingSoon">Coming Soon</div>
<script src="../js/store.js"></script>
</body>
</html>

BIN
icons/icon128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
icons/icon16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
icons/icon48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
images/anonlogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 KiB

BIN
images/comingsoon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 KiB

BIN
images/debroslogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
images/github.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
images/optionsback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
images/popupback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
images/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
images/x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

265
js/background.js Normal file
View File

@ -0,0 +1,265 @@
let proxies = []; // Initially empty, will be populated from local storage or fetched from the server
let currentProxyIndex = 0; // Start with the first proxy
let proxyEnabled = false;
console.log("background.js is running");
function applyProxySettings(host, port, exceptions = []) {
const proxyConfig = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: "socks5",
host,
port,
},
bypassList: exceptions.concat([""]),
},
};
chrome.proxy.settings.set({ value: proxyConfig, scope: "regular" }, () => {
const lastError = chrome.runtime.lastError;
if (lastError) {
console.error("Error applying proxy settings:", lastError);
fallbackToNextProxy(); // Move to the next proxy if the current one fails
} else {
console.log(`Proxy applied: ${host}:${port}`);
proxyEnabled = true;
}
});
}
function clearProxySettings() {
chrome.proxy.settings.clear({}, () => {
const lastError = chrome.runtime.lastError;
if (lastError) {
console.error("Error clearing proxy settings:", lastError);
} else {
console.log("Proxy settings cleared.");
proxyEnabled = false;
currentProxyIndex = 0; // Reset to the first proxy
}
});
}
function fallbackToNextProxy() {
currentProxyIndex = (currentProxyIndex + 1) % proxies.length; // Move to the next proxy in the list
if (proxies.length > 0) {
const { host, port } = proxies[currentProxyIndex];
console.log(`Falling back to proxy: ${host}:${port}`);
applyProxySettings(host, port);
} else {
console.error("No proxies available to fall back to.");
}
}
function checkProxyFunctionality(proxy, callback) {
const proxyConfig = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: "socks5",
host: proxy.host,
port: proxy.port
},
bypassList: [""]
}
};
chrome.proxy.settings.set({ value: proxyConfig, scope: "regular" }, () => {
if (chrome.runtime.lastError) {
console.error("Error setting proxy for check:", chrome.runtime.lastError);
callback(false);
return;
}
// Use Mullvad's DNS server for privacy check
fetch('https://doh.mullvad.net/dns-query?dns=q80BAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB', {
mode: 'no-cors',
headers: { 'accept': 'application/dns-message' }
})
.then(response => {
if (response.ok) {
console.log("Proxy check successful");
callback(true); // Connection successful
} else {
console.log("Proxy check failed");
callback(false); // Connection failed
}
})
.catch(error => {
console.error("Error in proxy check:", error);
callback(false);
});
});
}
function enableFirstWorkingProxy(callback) {
let index = 0;
function tryNextProxy() {
if (index >= proxies.length) {
console.log("No working proxy found");
callback(false);
return;
}
const proxy = proxies[index];
console.log("Checking proxy:", proxy.host + ":" + proxy.port);
checkProxyFunctionality(proxy, (isWorking) => {
if (isWorking) {
currentProxyIndex = index; // Update currentProxyIndex
console.log("Found working proxy:", proxy.host + ":" + proxy.port);
applyProxySettings(proxy.host, proxy.port);
chrome.storage.local.set({ proxyEnabled: true, currentProxy: proxy });
callback(true);
} else {
index++;
tryNextProxy();
}
});
}
tryNextProxy();
}
function fetchProxies() {
console.log("Starting to fetch proxies...");
return fetch('https://raw.githubusercontent.com/DeBrosOfficial/ANyONe-Proxy-List/main/anonproxies.json') // list of public proxies
.then(response => {
console.log("Response status:", response.status);
if (!response.ok) {
console.error("Response not OK");
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
console.log("Data received:", data);
proxies = data;
// Save the proxies to local storage
chrome.storage.local.set({ 'proxyList': proxies }, () => {
console.log('Proxies updated and saved:', proxies);
});
})
.catch(error => {
console.error('Failed to fetch proxies:', error);
});
}
// Load proxies from storage on extension startup if they exist
chrome.storage.local.get('proxyList', function(result) {
if (result.proxyList) {
proxies = result.proxyList;
console.log('Loaded proxies from storage:', proxies);
} else {
console.log('No proxies found in local storage, fetch required.');
}
});
// This event listener runs when the extension is first installed or updated
chrome.runtime.onInstalled.addListener((details) => {
if (details.reason === "install") {
console.log("Extension installed for the first time. Fetching proxies...");
// Fetch proxies automatically on first install but don't enable them
fetchProxies().then(() => {
console.log("Proxies updated on first install.");
// Don't enable proxy automatically, just fetch and store it
});
}
});
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
console.log("Received message in background:", message);
if (message.action === "enableProxy") {
console.log("Enabling proxy...");
chrome.runtime.sendMessage({ action: "showLoadingMessage", message: "Please wait..." });
enableFirstWorkingProxy((success) => {
if (success) {
console.log("Proxy enabled successfully");
sendResponse({ status: "enabled", proxy: proxies[currentProxyIndex] });
} else {
console.log("Failed to enable proxy");
sendResponse({ status: "error", message: "No public proxy available at this moment. Please configure a custom proxy in the settings." });
}
});
} else if (message.action === "disableProxy") {
console.log("Disabling proxy...");
clearProxySettings();
chrome.storage.local.set({ proxyEnabled: false, proxyType: null });
sendResponse({ status: "disabled" });
chrome.tabs.query({}, function(tabs) {
for (let tab of tabs) {
chrome.tabs.sendMessage(tab.id, {action: "disableProxy"}, function(response) {
if (chrome.runtime.lastError) {
console.warn("Warning: Could not send message to tab " + tab.id + ". Tab might have been closed.", chrome.runtime.lastError.message);
}
});
}
});
} else if (message.action === "updateProxy") {
console.log("Updating proxy settings...");
if (message.type === "custom") {
// Custom proxy enable
applyProxySettings(message.proxy.host, parseInt(message.proxy.port), message.exceptions || []);
chrome.storage.local.set({
proxyEnabled: true,
proxyType: "custom",
proxyIP: message.proxy.host,
proxyPort: message.proxy.port
});
sendResponse({ status: "enabled", proxy: message.proxy });
chrome.tabs.query({}, function(tabs) {
for (let tab of tabs) {
chrome.tabs.sendMessage(tab.id, {action: "updatePopupState"}, function(response) {
if (chrome.runtime.lastError) {
console.warn("Warning: Could not send message to tab " + tab.id + ". Tab might have been closed.", chrome.runtime.lastError.message);
}
});
}
});
} else if (message.type === "public") {
// Public proxy enable
chrome.runtime.sendMessage({ action: "showLoadingMessage", message: "Please wait..." });
enableFirstWorkingProxy((success) => {
if (success) {
console.log("Public proxy enabled successfully");
sendResponse({ status: "enabled", proxy: proxies[currentProxyIndex] });
} else {
console.log("Failed to enable public proxy");
sendResponse({ status: "error", message: "No public proxy available at this moment. Please configure a custom proxy in the settings." });
}
});
} else if (message.type === "disabled") {
clearProxySettings();
chrome.storage.local.set({ proxyEnabled: false, proxyType: null });
sendResponse({ status: "disabled" });
chrome.tabs.query({}, function(tabs) {
for (let tab of tabs) {
chrome.tabs.sendMessage(tab.id, {action: "disableProxy"}, function(response) {
if (chrome.runtime.lastError) {
console.warn("Warning: Could not send message to tab " + tab.id + ". Tab might have been closed.", chrome.runtime.lastError.message);
}
});
}
});
}
} else if (message.action === "updateProxies") {
console.log("Attempting to update proxies...");
fetchProxies().then(() => {
console.log("Proxies fetched successfully");
sendResponse({success: true, proxies: proxies});
chrome.runtime.sendMessage({ action: "updateStatus", message: "Proxy list updated successfully!", color: "#2ecc71" });
}).catch(error => {
console.error("Failed to fetch proxies:", error);
sendResponse({success: false, message: "Failed to update proxy list."});
chrome.runtime.sendMessage({ action: "updateStatus", message: "Failed to update proxy list.", color: "#e74c3c" });
});
return true; // Indicates this is an async response
} else {
console.log("Unknown action received:", message.action);
sendResponse({ status: "error", message: "Unknown action." });
}
return true;
});

214
js/options.js Normal file
View File

@ -0,0 +1,214 @@
const proxyIP = document.getElementById("proxyIP");
const proxyPort = document.getElementById("proxyPort");
const noProxyFor = document.getElementById("noProxyFor");
const saveSettings = document.getElementById("saveSettings");
const disableProxy = document.getElementById("disableProxy");
const statusMessage = document.getElementById("statusMessage");
const checkAnyoneButton = document.getElementById('checkAnyoneButton');
// Validate IP address
function isValidIP(ip) {
const ipRegex = /^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})$/;
return ipRegex.test(ip);
}
// Validate port number
function isValidPort(port) {
const num = parseInt(port, 10);
return num > 0 && num <= 65535;
}
// Load saved settings on page load
chrome.storage.local.get(["proxyIP", "proxyPort", "proxyType", "noProxyFor"], (settings) => {
if (chrome.runtime.lastError) {
console.error("Error retrieving settings:", chrome.runtime.lastError);
return;
}
proxyIP.value = settings.proxyIP || "";
proxyPort.value = settings.proxyPort || "";
noProxyFor.value = settings.noProxyFor || "";
});
// Function to check internet connectivity
function checkInternetConnection(host, port) {
return new Promise((resolve, reject) => {
const proxyConfig = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: "socks5",
host: host,
port: parseInt(port, 10)
},
bypassList: [""]
}
};
chrome.proxy.settings.set({ value: proxyConfig, scope: "regular" }, () => {
if (chrome.runtime.lastError) {
reject(chrome.runtime.lastError.message);
return;
}
fetch('https://doh.mullvad.net/dns-query?dns=q80BAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB', {
method: 'GET',
mode: 'no-cors',
headers: { 'accept': 'application/dns-message' }
})
.then(response => {
if (response.ok) {
resolve(true); // Connection successful
} else {
reject("Failed to connect via proxy"); // Connection failed
}
})
.catch(error => {
reject(error.message || "Network error encountered");
});
});
});
}
// Function to apply Proxy Settings after saving
function applyProxySettings(host, port, exceptions = []) {
const proxyConfig = {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme: "socks5",
host: host,
port: parseInt(port, 10)
},
bypassList: exceptions.concat([""])
}
};
chrome.proxy.settings.set({ value: proxyConfig, scope: "regular" }, () => {
if (chrome.runtime.lastError) {
statusMessage.textContent = "Error applying proxy: " + chrome.runtime.lastError.message;
statusMessage.style.color = "red";
statusMessage.style.fontSize = "14px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
} else {
console.log(`Proxy applied: ${host}:${port}`);
statusMessage.textContent = `Proxy applied: ${host}:${port}`;
statusMessage.style.color = "#2ecc71";
statusMessage.style.fontSize = "16px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
clearStatusMessage();
}
});
}
// Function to clear status message after a delay
function clearStatusMessage() {
setTimeout(() => {
statusMessage.textContent = "";
}, 5000); // Clear message after 5 seconds (5000 milliseconds)
}
// Save settings when clicking "Save Settings"
saveSettings.addEventListener("click", () => {
if (!isValidIP(proxyIP.value)) {
statusMessage.textContent = "Invalid IP address.";
statusMessage.style.color = "red";
statusMessage.style.fontSize = "16px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
return;
}
if (!isValidPort(proxyPort.value)) {
statusMessage.textContent = "Invalid port number. Must be between 1 and 65535.";
statusMessage.style.color = "red";
statusMessage.style.fontSize = "14px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
return;
}
statusMessage.textContent = "Please wait...";
statusMessage.style.color = "#f39c12";
statusMessage.style.fontSize = "16px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
const noProxyExceptions = noProxyFor.value.split(',').map(ex => ex.trim());
const filteredExceptions = noProxyExceptions.filter(ex => ex !== '');
checkInternetConnection(proxyIP.value, proxyPort.value)
.then(() => {
chrome.storage.local.set({
proxyIP: proxyIP.value,
proxyPort: proxyPort.value,
proxyType: "custom",
noProxyFor: filteredExceptions.join(", "),
proxyEnabled: true
}, () => {
if (chrome.runtime.lastError) {
statusMessage.textContent = "Error saving settings: " + chrome.runtime.lastError.message;
statusMessage.style.color = "red";
statusMessage.style.fontSize = "14px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
} else {
statusMessage.textContent = "Proxy settings saved and connection verified!";
statusMessage.style.color = "#2ecc71";
statusMessage.style.fontSize = "16px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
applyProxySettings(proxyIP.value, proxyPort.value, filteredExceptions);
chrome.runtime.sendMessage({ action: "updateProxy", type: "custom", proxy: { host: proxyIP.value, port: parseInt(proxyPort.value) }, exceptions: filteredExceptions });
clearStatusMessage();
}
});
})
.catch((error) => {
statusMessage.textContent = `Proxy connection failed: ${error}. Settings not applied.`;
statusMessage.style.color = "red";
statusMessage.style.fontSize = "14px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
chrome.proxy.settings.clear({});
});
});
disableProxy.addEventListener("click", () => {
chrome.proxy.settings.clear({}, () => {
if (chrome.runtime.lastError) {
statusMessage.textContent = "Error disabling proxy: " + chrome.runtime.lastError.message;
statusMessage.style.color = "red";
statusMessage.style.fontSize = "14px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
} else {
statusMessage.textContent = "Proxy has been disabled!";
statusMessage.style.color = "#e74c3c";
statusMessage.style.fontSize = "16px";
statusMessage.style.fontFamily = "Arial";
statusMessage.style.fontWeight = "bold";
clearStatusMessage();
console.log("Proxy settings disabled.");
chrome.storage.local.get(["noProxyFor"], (result) => {
chrome.storage.local.set({
proxyType: null,
noProxyFor: result.noProxyFor,
proxyEnabled: false
}, () => {
if (chrome.runtime.lastError) {
console.error("Error updating storage:", chrome.runtime.lastError);
} else {
chrome.runtime.sendMessage({ action: "disableProxy" });
}
});
});
clearStatusMessage();
}
});
});
// Open Check Anyone page
checkAnyoneButton.addEventListener("click", () => {
window.open("https://check.en.anyone.tech/", "_blank");
});

179
js/popup.js Normal file
View File

@ -0,0 +1,179 @@
document.addEventListener("DOMContentLoaded", () => {
const proxyToggle = document.getElementById("proxyToggle");
const statusMessage = document.getElementById("statusMessage");
const optionsButton = document.getElementById("optionsButton");
const checkAnyoneButton = document.getElementById("checkAnyoneButton");
const dappStoreButton = document.getElementById("dappStoreButton");
const updateProxiesButton = document.getElementById("updateProxiesButton");
if (!checkAnyoneButton) {
checkAnyoneButton = document.createElement("button");
checkAnyoneButton.id = "checkAnyoneButton";
checkAnyoneButton.textContent = "Check ANyONe";
checkAnyoneButton.style.marginBottom = "10px";
checkAnyoneButton.addEventListener("click", () => {
window.open("https://check.en.anyone.tech/", "_blank");
});
}
if (!dappStoreButton) {
dappStoreButton = document.createElement("button");
dappStoreButton.id = "dappStoreButton";
dappStoreButton.textContent = "dApp Store";
dappStoreButton.style.marginBottom = "10px";
dappStoreButton.addEventListener("click", () => {
const storeUrl = chrome.runtime.getURL("store.html");
chrome.tabs.create({ url: storeUrl });
});
}
if (updateProxiesButton) {
updateProxiesButton.addEventListener("click", () => {
console.log("Update Proxies button clicked in popup.js");
statusMessage.textContent = "Updating proxies...";
statusMessage.style.color = "#f39c12"; // Orange for loading
chrome.runtime.sendMessage({ action: "updateProxies" }, (response) => {
if (response && response.success) {
console.log('Proxy list update was successful');
statusMessage.textContent = 'Proxies updated successfully!';
statusMessage.style.color = "#2ecc71"; // Green for success
} else {
console.log('Proxy list update failed');
statusMessage.textContent = 'Failed to update proxies.';
statusMessage.style.color = "#e74c3c"; // Red for failure
}
// Clear the update message after 3 seconds and reinitialize the UI
setTimeout(() => {
initializeUI();
}, 3000);
});
});
}
const buttonContainer = document.querySelector(".button-container");
if (buttonContainer) {
buttonContainer.innerHTML = '';
buttonContainer.appendChild(optionsButton);
buttonContainer.appendChild(dappStoreButton);
buttonContainer.appendChild(updateProxiesButton);
}
if (statusMessage && !checkAnyoneButton.parentNode) {
statusMessage.parentNode.insertBefore(checkAnyoneButton, statusMessage.nextSibling);
}
function updateStatusMessage(isEnabled, proxyType, proxy) {
if (isEnabled) {
if (proxyType === "custom") {
statusMessage.textContent = `Custom Proxy is ENABLED and routing through ${proxy.host}:${proxy.port}`;
statusMessage.style.color = "#2ecc71"; // Green for custom
} else {
statusMessage.textContent = `Public Proxy is ENABLED and routing through ${proxy.host}:${proxy.port}`;
statusMessage.style.color = "#03bdc5"; // Blue for public
}
} else {
statusMessage.textContent = "Proxy is DISABLED";
statusMessage.style.color = "#e74c3c";
}
}
function updateUI(isEnabled, proxyType, proxy) {
proxyToggle.checked = isEnabled;
updateStatusMessage(isEnabled, proxyType, proxy);
}
function updateStatusFromBackground(data) {
statusMessage.textContent = data.message;
statusMessage.style.color = data.color;
setTimeout(() => {
statusMessage.textContent = "";
initializeUI(); // Reinitialize the UI to show the current status
}, 3000);
}
// Initialize the toggle state
function initializeUI() {
chrome.storage.local.get(["proxyEnabled", "proxyType", "currentProxy", "proxyIP", "proxyPort"], (data) => {
const isEnabled = data.proxyEnabled || false;
const proxyType = data.proxyType || "public";
const currentProxy = proxyType === "custom"
? { host: data.proxyIP || "127.0.0.1", port: data.proxyPort || 9050 }
: (data.currentProxy || { host: "51.75.175.24", port: 9052 }); // Default public Proxy
updateUI(isEnabled, proxyType, currentProxy);
});
}
initializeUI();
proxyToggle.addEventListener("change", () => {
const isEnabled = proxyToggle.checked;
if (isEnabled) {
chrome.storage.local.get(["proxyType"], (data) => {
if (data.proxyType === "custom") {
chrome.storage.local.get(["proxyIP", "proxyPort"], (settings) => {
chrome.runtime.sendMessage({ action: "updateProxy", type: "custom", proxy: { host: settings.proxyIP, port: settings.proxyPort } }, (response) => {
if (response && response.status === "enabled") {
updateUI(true, "custom", { host: settings.proxyIP, port: settings.proxyPort });
} else {
alert("Failed to enable custom proxy. Please try again.");
proxyToggle.checked = false;
initializeUI();
}
});
});
} else {
chrome.runtime.sendMessage({ action: "enableProxy" }, (response) => {
if (response && response.status === "enabled" && response.proxy) {
chrome.storage.local.set({ proxyEnabled: true, currentProxy: response.proxy, proxyType: "public" });
updateUI(true, "public", response.proxy);
} else {
alert(response.message || "Failed to enable public proxy. Please try again.");
proxyToggle.checked = false;
initializeUI();
}
});
}
});
} else {
chrome.runtime.sendMessage({ action: "disableProxy" }, (response) => {
if (response && response.status === "disabled") {
chrome.storage.local.set({ proxyEnabled: false, proxyType: null });
updateUI(false);
} else {
alert("Failed to disable proxy. Please try again.");
proxyToggle.checked = true;
initializeUI();
}
});
}
});
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === "updatePopupState" || message.action === "disableProxy") {
initializeUI();
} else if (message.action === "showLoadingMessage") {
statusMessage.textContent = message.message;
statusMessage.style.color = "#f39c12"; // Orange for loading
} else if (message.action === "updateStatus") {
updateStatusFromBackground(message);
}
});
// Open options page
optionsButton.addEventListener("click", () => {
chrome.runtime.openOptionsPage();
});
// Open Check Anyone page
checkAnyoneButton.addEventListener("click", () => {
window.open("https://check.en.anyone.tech/", "_blank");
});
// Open dApp Store page
dappStoreButton.addEventListener("click", () => {
const storeUrl = chrome.runtime.getURL("html/store.html");
chrome.tabs.create({ url: storeUrl });
});
});

27
js/store.js Normal file
View File

@ -0,0 +1,27 @@
document.addEventListener("DOMContentLoaded", () => {
const comingSoonText = document.getElementById("comingSoon");
const comingSoonImage = document.getElementById("fullScreenImage");
// Check if the domain is working
fetch('https://store.debros.io', { method: 'HEAD', mode: 'no-cors' })
.then(response => {
if (response.ok) {
window.location.href = 'https://store.debros.io';
} else {
showComingSoonMessage();
}
})
.catch(() => {
showComingSoonMessage();
});
function showComingSoonMessage() {
setTimeout(() => {
comingSoonImage.style.opacity = 1;
}, 200);
setTimeout(() => {
comingSoonText.style.opacity = 1;
}, 1000);
}
});

32
manifest.json Normal file
View File

@ -0,0 +1,32 @@
{
"manifest_version": 3,
"name": "ANyONe Extension",
"version": "1.0.2",
"description": "Manage Socks5 proxy settings",
"permissions": [
"proxy",
"storage",
"tabs",
"scripting"
],
"host_permissions": ["<all_urls>"],
"background": {
"service_worker": "js/background.js"
},
"action": {
"default_popup": "html/popup.html",
"default_title": "Proxy Settings"
},
"options_ui": {
"page": "html/options.html",
"open_in_tab": true
},
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
}
}

6
package-lock.json generated Normal file
View File

@ -0,0 +1,6 @@
{
"name": "ANyONe-Extension",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}