.file-url:hover white-space: normal; word-break: break-all;
// 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;
// initial demo load to show blocker concept (non-intrusive) loadDemoExamples(); </script> </body> </html>
/* input area */ .input-group margin-bottom: 28px; simple run blocker download
// Event binding allowBtn.addEventListener('click', () => const rawUrl = urlInput.value; if (!rawUrl.trim()) updateStatusMessage("Please enter a URL to whitelist & download", "#ffb77c"); return; addToWhitelistAndDownload(rawUrl); urlInput.value = ''; // optional clear after use );
body background: linear-gradient(145deg, #101418 0%, #1a1f2c 100%); font-family: 'Segoe UI', Roboto, system-ui, 'Helvetica Neue', sans-serif; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; padding: 24px;
.url-input:focus border-color: #6c7eff; box-shadow: 0 0 0 3px #6c7eff30; background: #070a10; In real case, we treat it as unknown but apply blocker
<div class="action-row"> <button id="allowBtn" class="btn btn-primary">➕ ALLOW & DOWNLOAD</button> <button id="blockDemoBtn" class="btn btn-danger">🚫 BLOCK DEMO (fake run)</button> <button id="clearAllBtn" class="btn btn-warning">🗑️ CLEAR WHITELIST</button> </div>
// Helper: update UI for blocked list (quarantine) function renderBlockedList() if (!blockedListEl) return; if (blockedItems.length === 0) blockedListEl.innerHTML = '<li class="empty-msg">✨ No blocked attempts. Run blocker is watching.</li>'; return; // show latest first (reverse) const reversed = [...blockedItems].reverse(); blockedListEl.innerHTML = reversed.map((item, idx) => const displayUrl = item.url.length > 65 ? item.url.substring(0, 62) + '...' : item.url; const timeStr = item.timestamp ? new Date(item.timestamp).toLocaleTimeString() : 'just now'; return ` <li> <span class="file-url" title="$escapeHtml(item.url)">🚫 $escapeHtml(displayUrl)</span> <span style="font-size:0.7rem; background:#1e1f2e; padding:2px 8px; border-radius:40px;">$timeStr</span> <button class="remove-btn" data-url="$escapeHtml(item.url)" data-removeidx="$blockedItems.length - 1 - idx">✖</button> </li> `; ).join('');
.section-title font-size: 0.85rem; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; color: #7f8bb3; padding: 12px 16px 4px; display: flex; justify-content: space-between; 62) + '...' : item.url
.btn-warning:hover background: #c5822a;
.info-panel p margin: 0 0 8px 0; color: #cbd5ff; font-weight: 500; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
/* queue / blocked list */ .queue-section background: #0c0f18; border-radius: 24px; padding: 6px 4px 12px 4px; margin-top: 20px;
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <title>Simple Run Blocker · Download Manager</title> <style> * box-sizing: border-box; user-select: none; /* prevents accidental text selection on buttons, but keeps text readable */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|