@@ -65,6 +70,10 @@ const team = [
}).join('');
+ // Add list role to grid for screen readers
+ grid.setAttribute('role', 'list');
+ grid.setAttribute('aria-label', 'Team members');
+
})();
let teamOpen = false;
@@ -94,6 +103,168 @@ function toggleTeam() {
}
}
+// ─────────────────────────────
+// SECURITY TIPS
+// ─────────────────────────────
+
+const TIPS = {
+
+ MALWARE: [
+ 'Never download files or software from untrusted or unfamiliar websites.',
+ 'Keep your antivirus software updated and run regular scans.',
+ 'Avoid clicking links in unsolicited emails or messages — they may silently install malware.',
+ 'Use a reputable ad blocker; malicious ads can trigger drive-by downloads.',
+ 'Keep your OS and browser updated — patches close exploits malware relies on.',
+ ],
+
+ SOCIAL_ENGINEERING: [
+ 'Legitimate websites never ask for your password via email or a popup.',
+ 'Always check the full URL carefully — phishing sites mimic real ones with subtle typos.',
+ 'Look for HTTPS and a valid padlock before entering any personal information.',
+ 'When in doubt, go directly to the official website instead of clicking a link.',
+ 'Enable two-factor authentication (2FA) so stolen passwords alone cannot access your accounts.',
+ ],
+
+ UNWANTED_SOFTWARE: [
+ 'Only install software from official sources like verified app stores or developer sites.',
+ 'Read permissions carefully before installing browser extensions or apps.',
+ 'Regularly audit installed programs and remove anything you do not recognise.',
+ 'Avoid "free" software bundles — they often include unwanted programs bundled silently.',
+ 'Use a browser with built-in protection against unwanted software downloads.',
+ ],
+
+ POTENTIALLY_HARMFUL_APPLICATION: [
+ 'Avoid sideloading apps from outside official stores unless you fully trust the source.',
+ 'Check app reviews and publisher details before granting installation permissions.',
+ 'Revoke unnecessary permissions for apps that request access to sensitive data.',
+ 'Keep your device OS updated to protect against known app vulnerabilities.',
+ 'Use a mobile security app to scan for potentially harmful applications.',
+ ],
+
+ general: [
+ 'Use a password manager to generate and store strong, unique passwords.',
+ 'Enable two-factor authentication on every account that supports it.',
+ 'Regularly back up important data to an offline or encrypted cloud location.',
+ 'Avoid using public Wi-Fi for banking or sensitive logins without a VPN.',
+ 'Review your privacy settings on social media — oversharing aids social engineering.',
+ 'Check "Have I Been Pwned" (haveibeenpwned.com) to see if your email was leaked.',
+ 'Be sceptical of urgency — scammers manufacture time pressure to bypass your judgement.',
+ 'Lock your devices with a strong PIN or biometric — physical access is a real threat.',
+ 'Use a DNS-level blocker like 1.1.1.1 with filtering to block malicious domains.',
+ 'Think before you click. Pause, inspect the URL, then decide.',
+ ],
+
+};
+
+// Tracks last shown general tip index to avoid repeats
+let lastGeneralTipIndex = -1;
+
+function getRandomTip(arr, lastIndex = -1) {
+ let index;
+ do {
+ index = Math.floor(Math.random() * arr.length);
+ } while (arr.length > 1 && index === lastIndex);
+ lastGeneralTipIndex = index;
+ return { tip: arr[index], index };
+}
+
+function buildTipsHtml(threatTypes) {
+
+ const isThreat = threatTypes && threatTypes.length > 0;
+
+ if (isThreat) {
+
+ // Collect unique tip sets for each detected threat type
+ const sections = [];
+
+ const threatLabels = {
+ MALWARE: { label: 'Malware', icon: '🦠' },
+ SOCIAL_ENGINEERING: { label: 'Phishing / Social Engineering', icon: '🎣' },
+ UNWANTED_SOFTWARE: { label: 'Unwanted Software', icon: '📦' },
+ POTENTIALLY_HARMFUL_APPLICATION: { label: 'Harmful Application', icon: '⚠️' },
+ };
+
+ threatTypes.forEach(threat => {
+ const tipPool = TIPS[threat];
+ if (!tipPool) return;
+
+ const meta = threatLabels[threat] || { label: threat, icon: '⚠️' };
+
+ // Pick 3 random non-repeating tips from the pool
+ const shuffled = [...tipPool].sort(() => Math.random() - 0.5).slice(0, 3);
+
+ sections.push(`
+
- ⬇ Download PDF
- ⬇ Download Image
+ ⬇ Download PDF
+ ⬇ Download Image
` : ''}
`;
+ // Move focus to result div so screen readers announce the outcome
+ const resultEl = document.getElementById('result');
+ resultEl.setAttribute('tabindex', '-1');
+ resultEl.focus();
+
if (riskSectionHtml) {
+ // Append risk section inside result div, after the result card
+ resultEl.insertAdjacentHTML('beforeend', riskSectionHtml);
+
setTimeout(() => {
const bar = document.querySelector('.risk-meter-bar');
if (bar) {
@@ -464,27 +637,29 @@ async function checkSecurity() {
document.getElementById('scanBtn');
btn.disabled = true;
+ btn.setAttribute('aria-busy', 'true');
+ btn.setAttribute('aria-label', 'Scanning URL, please wait...');
// Loading State — enhanced scan animation
document.getElementById('result').innerHTML = `
-
+
-
+
-
+
Scanning URL...
-
${url}
+
${url}
-
+
@@ -540,23 +715,37 @@ async function checkSecurity() {
updateStats('danger');
showResult('danger', 'Threat Detected!',
`This URL is flagged as dangerous. Do not visit it.