// ═══════════════════════════════════════════════════════════ // AUTO-CLICKER FOR "Accept", "Run" & "Allow" (TRUSTED TYPES COMPLIANT) // ═══════════════════════════════════════════════════════════ (function() { 'use strict';
const state = {
interval: null,
totalClicks: 0,
isCollapsed: true
};
function cleanup() {
if (window.autoClickerInterval) clearInterval(window.autoClickerInterval);
const oldUI = document.getElementById('auto-clicker-indicator');
if (oldUI) oldUI.remove();
}
function createUI() {
const container = document.createElement('div');
container.id = 'auto-clicker-indicator';
container.style.cssText = `
position: fixed; top: 20px; left: 20px;
background: #2d2d30; color: #cccccc;
padding: 8px 12px; border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
font-family: sans-serif; font-size: 14px; z-index: 999999;
border: 1px solid #007acc; min-width: 170px;
`;
const titleBar = document.createElement('div');
titleBar.style.cssText = 'display: flex; justify-content: space-between; align-items: center; cursor: move;';
const titleText = document.createElement('span');
titleText.textContent = '🎯 Accept/Run/Allow Bot';
titleText.style.fontWeight = 'bold';
titleText.style.color = '#4ec9b0';
const collapseBtn = document.createElement('button');
collapseBtn.textContent = '+';
collapseBtn.style.cssText = 'background: transparent; color: #ccc; border: 1px solid #555; cursor: pointer; padding: 0 5px;';
titleBar.appendChild(titleText);
titleBar.appendChild(collapseBtn);
const wrapper = document.createElement('div');
wrapper.id = 'content-wrapper';
wrapper.style.display = 'none';
wrapper.style.marginTop = '10px';
const stats = document.createElement('div');
stats.style.marginBottom = '8px';
stats.textContent = 'Acciones: ';
const clickCount = document.createElement('span');
clickCount.id = 'click-count';
clickCount.textContent = '0';
clickCount.style.color = '#4ec9b0';
clickCount.style.fontWeight = 'bold';
stats.appendChild(clickCount);
const label = document.createElement('label');
label.style.cssText = 'display: flex; align-items: center; margin-bottom: 8px; cursor: pointer;';
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = 'auto-click-checkbox';
checkbox.checked = true;
checkbox.style.marginRight = '8px';
label.appendChild(checkbox);
label.appendChild(document.createTextNode('Enable Auto-Click'));
const stopBtn = document.createElement('button');
stopBtn.textContent = 'Stop Bot';
stopBtn.style.cssText = 'width: 100%; padding: 5px; background: #c74440; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold;';
wrapper.appendChild(stats);
wrapper.appendChild(label);
wrapper.appendChild(stopBtn);
container.appendChild(titleBar);
container.appendChild(wrapper);
document.body.appendChild(container);
collapseBtn.onclick = () => {
state.isCollapsed = !state.isCollapsed;
wrapper.style.display = state.isCollapsed ? 'none' : 'block';
collapseBtn.textContent = state.isCollapsed ? '+' : '−';
};
stopBtn.onclick = () => {
clearInterval(state.interval);
container.remove();
console.log('🛑 Bot detenido');
};
return container;
}
function findAndClickButton() {
const autoClickEnabled = document.getElementById('auto-click-checkbox')?.checked;
if (!autoClickEnabled) return;
const scan = (doc) => {
const targets = doc.querySelectorAll('button, span');
targets.forEach(el => {
const text = el.textContent.trim().toLowerCase();
const className = el.className.toString();
// CONDICIÓN 1: Botón "Accept"
const isAccept = text.includes('accept') &&
(className.includes('ide-button') || className.includes('cursor-pointer'));
// CONDICIÓN 2: Botones "Run" o "Allow"
// Verificamos si el texto empieza por run/allow y tiene las clases de botón primario
const isActionBtn = (text.startsWith('run') || text.startsWith('allow')) &&
(className.includes('bg-primary') || el.closest('button')?.className.includes('bg-primary'));
if ((isAccept || isActionBtn) && el.offsetWidth > 0 && el.offsetHeight > 0) {
// Si el elemento detectado es un span dentro de un botón, seleccionamos el botón padre
const elementToClick = (el.tagName === 'SPAN' && el.closest('button')) ? el.closest('button') : el;
if (elementToClick && !elementToClick.disabled) {
console.log(`✅ Haciendo clic en: ${text.split('\n')[0]}`); // Log limpio
elementToClick.click();
state.totalClicks++;
const countEl = document.getElementById('click-count');
if (countEl) countEl.textContent = state.totalClicks;
}
}
});
};
// Escanear página principal
scan(document);
// Escanear Iframes
document.querySelectorAll('iframe').forEach(iframe => {
try {
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
scan(iframeDoc);
} catch (e) {}
});
}
// Iniciar
cleanup();
createUI();
state.interval = setInterval(findAndClickButton, 3000);
console.log('🚀 Bot iniciado: Buscando "Accept", "Run" y "Allow"...');
})();