Simple Run Blocker Download -
<!-- blocked queue simulation --> <div class="queue-section"> <div class="section-title"> <span>📋 BLOCKED / QUARANTINED REQUESTS</span> <span style="font-size:0.7rem;">(auto-blocked runs)</span> </div> <ul id="blockedList" class="blocked-list"> <li class="empty-msg">⚡ No blocked attempts yet. Try "BLOCK DEMO" or simulate a download.</li> </ul> </div>
function updateStatusMessage(msg, color = '#b5ff9e') if (statusSpan) statusSpan.textContent = msg; statusSpan.style.color = color; setTimeout(() => if (statusSpan.textContent === msg) statusSpan.style.color = '#87e987'; statusSpan.textContent = '✅ ready'; , 2800);
// core run blocker: simulate blocking a "run/download" attempt if URL not whitelisted function attemptDownload(url, source = 'manual') url.trim() === '') updateStatusMessage('❌ No URL provided', '#ff9e8f'); return false; let cleanUrl = url.trim(); // simple validation: basic http/https or relative? we accept http/https/ftp/blob? but for demo we support http/https if (!cleanUrl.match(/^https?:\/\//i) && !cleanUrl.startsWith('blob:') && !cleanUrl.startsWith('data:')) // for simplicity, still allow but warn. In real case, we treat it as unknown but apply blocker. if (!cleanUrl.includes('.')) updateStatusMessage(`⚠️ suspicious format: "$shorten(cleanUrl, 45)" — blocked by run policy`, '#ffaa66'); addBlockedEntry(cleanUrl, 'Invalid/unsafe URL scheme (run blocker policy)'); renderBlockedList(); return false;
function shorten(str, maxLen) if (!str) return ''; return str.length > maxLen ? str.substring(0, maxLen-3) + '...' : str; simple run blocker download
blockDemoBtn.addEventListener('click', () => simulateBlockedRun(); );
// small UX alert simulation (non-intrusive) function triggerSimulatedBlockAlert(url) // just a visual flash effect on footer or info, but not annoying alert const footer = document.querySelector('footer'); if (footer) footer.style.transition = '0.1s'; footer.style.backgroundColor = '#4a2525'; setTimeout(() => footer.style.backgroundColor = ''; , 300); // optional: console log console.log(`[RUN BLOCKER] Blocked attempt: $url`);
.btn-warning background: #a56b1f; color: #ffe3b3; but for demo we support http/https if (
function addBlockedEntry(url, reason) blockedItems.unshift( // add to beginning for latest on top after render (but render reverses again? we render reversed, but unshift + reversed gives newer first) url: url, timestamp: new Date(), reason: reason ); // limit list to 30 items to avoid clutter if (blockedItems.length > 35) blockedItems.pop();
.btn border: none; font-weight: 700; padding: 12px 24px; border-radius: 60px; font-size: 0.9rem; cursor: pointer; transition: 0.15s linear; display: inline-flex; align-items: center; gap: 10px; background: #262d42; color: #eef3ff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
/* content */ .content padding: 28px 28px 32px; 0) const notify = document.createElement('div')
// Clear entire whitelist (reset) function clearWhitelist() const count = whitelist.size; whitelist.clear(); updateStatusMessage(`🧹 Cleared $count whitelisted URL(s). All downloads will be blocked now.`, "#ffbc7a"); // optional: add a system entry to blocked list? maybe not, but we keep blocked list intact if (count > 0) const notify = document.createElement('div'); renderBlockedList(); // just refresh display (blocked items remain)
// DOM elements const urlInput = document.getElementById('urlInput'); const allowBtn = document.getElementById('allowBtn'); const blockDemoBtn = document.getElementById('blockDemoBtn'); const clearAllBtn = document.getElementById('clearAllBtn'); const blockedListEl = document.getElementById('blockedList'); const statusSpan = document.getElementById('statusMsg');
<!-- add allowed URL --> <div class="input-group"> <div class="input-label"> <span>🔗 Whitelist URL (allow download)</span> <span>⚠️ only whitelisted items can be saved</span> </div> <input type="text" id="urlInput" class="url-input" placeholder="https://example.com/safe-file.zip , https://cdn.com/resource.pdf ..." value=""> </div>
.blocked-list list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto;