/** * Content script for FCC CORES (apps.fcc.gov/coresWeb/*) * * Injects a guidance overlay when on the CORES user management pages * to help the client add filings@performancewest.net as an authorized user. */ (function() { 'use strict'; const PW_EMAIL = 'filings@performancewest.net'; // Only inject on relevant pages const url = window.location.href.toLowerCase(); if (!url.includes('coresweb') && !url.includes('cores')) return; // Wait for page to load setTimeout(injectGuidance, 2000); function injectGuidance() { // Look for user management forms or "Add User" buttons const addUserBtn = document.querySelector('input[value*="Add"], button:contains("Add User"), a[href*="addUser"]'); const emailFields = document.querySelectorAll('input[type="text"][name*="email"], input[type="email"]'); // Inject floating helper banner const banner = document.createElement('div'); banner.id = 'pw-cores-helper'; banner.innerHTML = `
Performance West Helper

Add this email as an authorized user on your FRN:

${PW_EMAIL}

Click the email to copy. Then paste it into the "Add User" form above.

`; document.body.appendChild(banner); // Close button document.getElementById('pw-close')?.addEventListener('click', () => banner.remove()); // Copy on click document.getElementById('pw-email-copy')?.addEventListener('click', () => { navigator.clipboard.writeText(PW_EMAIL).then(() => { const el = document.getElementById('pw-email-copy'); if (el) { el.textContent = 'Copied!'; setTimeout(() => el.textContent = PW_EMAIL, 1500); } }); }); // Auto-fill email fields if empty emailFields.forEach(field => { if (!field.value) { field.value = PW_EMAIL; field.style.backgroundColor = '#eff6ff'; field.style.borderColor = '#93c5fd'; } }); } })();