Merchant Center Auth
body { font-family: sans-serif; display: flex; align-items: center; justify-content: center; min-height: 60vh; margin: 0; background: #f9f9f9; }
.box { background: white; border-radius: 12px; padding: 2rem; text-align: center; max-width: 400px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
h2 { font-size: 18px; margin: 0 0 8px; }
p { font-size: 13px; color: #666; margin: 0 0 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: 10px; background: #4285F4; color: white; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; font-weight: 500; cursor: pointer; }
.status { font-size: 13px; color: #666; margin-top: 1rem; }
Merchant Center Manager
Autoriza el acceso para gestionar tus cuentas de Google Merchant Center.
Autorizar con Google
const CLIENT_ID = ‘242758549475-gtl8degkfqcgr7sf28egb29898dtbf6o.apps.googleusercontent.com’;
const SCOPE = ‘https://www.googleapis.com/auth/content’;
function doAuth() {
document.getElementById(‘status’).textContent = ‘Iniciando…’;
const waitForGSI = setInterval(() => {
if (window.google && window.google.accounts) {
clearInterval(waitForGSI);
const tc = google.accounts.oauth2.initTokenClient({
client_id: CLIENT_ID,
scope: SCOPE,
callback: (r) => {
if (r.error) {
document.getElementById(‘status’).textContent = ‘Error: ‘ + r.error_description;
return;
}
document.getElementById(‘status’).textContent = ‘Autorizado. Cerrando…’;
if (window.opener) {
window.opener.postMessage({ type: ‘MC_TOKEN’, token: r.access_token }, ‘https://claude.ai’);
setTimeout(() => window.close(), 800);
} else {
sessionStorage.setItem(‘mc_token’, r.access_token);
document.getElementById(‘status’).textContent = ‘Token guardado. Puedes cerrar esta pestaña y volver al panel.’;
}
}
});
tc.requestAccessToken({ prompt: ‘consent’ });
}
}, 100);
}
window.addEventListener(‘load’, () => {
const params = new URLSearchParams(window.location.search);
if (params.get(‘auto’) === ‘1’) doAuth();
});