Commit 6f77a0e3 authored by Stefy Spora's avatar Stefy Spora

Add Web3/MetaMask donation functionality

- Added MetaMask donation button to popup interface
- Integrated Web3 functionality for one-click ETH donations
- Added Ethereum address: 0xdA6dAb526515b5cb556d20269207D43fcc760E51
- Updated documentation with Web3 donation options
- Enhanced popup UI with both Bitcoin and Ethereum donation methods
parent 1d8b8552
......@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Progress tracking and error reporting
- Comprehensive error handling and recovery
- Rate limiting to prevent server overload
- Web3/MetaMask donation integration with one-click functionality
### Technical Features
- Modern XHR/Fetch API implementation
......@@ -48,4 +49,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Website: [sexhack.me](https://www.sexhack.me) (NSFW)
- Source Code: [git.nexlab.net/sexhackme/fetprivacy](https://git.nexlab.net/sexhackme/fetprivacy)
- License: GNU General Public License v3.0
- Web3/MetaMask Donations: `0xdA6dAb526515b5cb556d20269207D43fcc760E51`
- Bitcoin Donations: `bc1qcpt2uutqkz4456j5r78rjm3gwq03h5fpwmcc5u`
\ No newline at end of file
......@@ -110,6 +110,9 @@ This project is open source under the GPLv3 license. Contributions, bug reports,
If you find this extension useful, consider supporting its development:
**Web3/MetaMask Donations:** `0xdA6dAb526515b5cb556d20269207D43fcc760E51`
*(Click the MetaMask button in the extension popup for easy donation)*
**Bitcoin Donations:** `bc1qcpt2uutqkz4456j5r78rjm3gwq03h5fpwmcc5u`
## Author & Credits
......
......@@ -95,11 +95,28 @@
<a href="https://www.sexhack.me" target="_blank" style="color: #4CAF50; text-decoration: none;">sexhack.me</a>
<span style="color: #f44336; font-weight: bold;">(NSFW)</span>
</div>
<div style="margin-bottom: 5px;">
<div style="margin-bottom: 8px;">
<a href="https://git.nexlab.net/sexhackme/fetprivacy" target="_blank" style="color: #2196F3; text-decoration: none;">Source Code</a>
</div>
<div style="margin-bottom: 8px;">
<strong>💰 Donate:</strong>
</div>
<div style="margin-bottom: 6px;">
<button id="web3-donate-btn" style="background: linear-gradient(45deg, #f6851b, #e2761b); color: white; border: none; padding: 4px 8px; border-radius: 4px; font-size: 10px; cursor: pointer; margin-bottom: 4px;">
🦊 Donate with MetaMask
</button>
<div id="web3-status" style="font-size: 9px; color: #666; display: none;"></div>
</div>
<div style="font-size: 10px; margin-bottom: 4px;">
<strong>ETH/Web3:</strong><br>
<span style="font-family: monospace; font-size: 9px; word-break: break-all;">0xdA6dAb526515b5cb556d20269207D43fcc760E51</span>
</div>
<div style="font-size: 10px;">
<strong>Donate:</strong><br>
<strong>Bitcoin:</strong><br>
<span style="font-family: monospace; font-size: 9px; word-break: break-all;">bc1qcpt2uutqkz4456j5r78rjm3gwq03h5fpwmcc5u</span>
</div>
</div>
......
......@@ -218,8 +218,93 @@ document.addEventListener('DOMContentLoaded', function() {
stopBtn.textContent = 'Stopping...';
showProgress('Stopping after current page...');
});
// Web3/MetaMask donation functionality
const web3DonateBtn = document.getElementById('web3-donate-btn');
const web3Status = document.getElementById('web3-status');
function showWeb3Status(message, isError = false) {
web3Status.textContent = message;
web3Status.style.color = isError ? '#f44336' : '#4CAF50';
web3Status.style.display = 'block';
setTimeout(() => {
web3Status.style.display = 'none';
}, 5000);
}
web3DonateBtn.addEventListener('click', async function() {
try {
// Execute Web3 donation in the active tab context
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
const results = await chrome.scripting.executeScript({
target: { tabId: tab.id },
function: executeWeb3Donation
});
const result = results[0].result;
showWeb3Status(result.message, !result.success);
} catch (error) {
console.error('Web3 donation error:', error);
showWeb3Status('Failed to initiate donation: ' + error.message, true);
}
});
});
// Function to be injected for Web3 donation
function executeWeb3Donation() {
return new Promise(async (resolve) => {
try {
// Check if MetaMask is installed
if (typeof window.ethereum === 'undefined') {
resolve({ success: false, message: 'MetaMask not detected. Please install MetaMask extension.' });
return;
}
// Request account access
const accounts = await window.ethereum.request({
method: 'eth_requestAccounts'
});
if (accounts.length === 0) {
resolve({ success: false, message: 'No accounts found. Please unlock MetaMask.' });
return;
}
const donationAddress = '0xdA6dAb526515b5cb556d20269207D43fcc760E51';
// Prepare transaction parameters (user can modify amount in MetaMask)
const transactionParameters = {
to: donationAddress,
from: accounts[0],
value: '0x16345785D8A0000', // 0.1 ETH in wei (default amount, user can change)
gas: '0x5208', // 21000 gas limit for simple transfer
};
// Send transaction
const txHash = await window.ethereum.request({
method: 'eth_sendTransaction',
params: [transactionParameters],
});
resolve({ success: true, message: `Transaction sent! Hash: ${txHash.substring(0, 10)}...` });
} catch (error) {
console.error('Web3 donation error:', error);
if (error.code === 4001) {
resolve({ success: false, message: 'Transaction cancelled by user.' });
} else if (error.code === -32602) {
resolve({ success: false, message: 'Invalid transaction parameters.' });
} else {
resolve({ success: false, message: `Transaction failed: ${error.message}` });
}
}
});
}
// Function to find and click the next link
function findAndClickNext() {
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment