Skip to content

Feat/security tips#140

Open
shresthbhargava wants to merge 3 commits into
Mrinalray:mainfrom
shresthbhargava:feat/security-tips
Open

Feat/security tips#140
shresthbhargava wants to merge 3 commits into
Mrinalray:mainfrom
shresthbhargava:feat/security-tips

Conversation

@shresthbhargava

Copy link
Copy Markdown

Closes #130

What's Changed

script.js

Added a full SECURITY TIPS module with the following:

  • Threat-specific tips — when a threat is detected, tips are shown per threat type:
    • MALWARE → malware prevention tips
    • SOCIAL_ENGINEERING → phishing awareness tips
    • UNWANTED_SOFTWARE → software safety tips
    • POTENTIALLY_HARMFUL_APPLICATION → app safety tips
    • Each section shows 3 randomly picked tips from a pool of 5
  • Rotating general tips — when a URL is safe, a random cybersecurity tip is shown from a pool of 10
  • "Show another tip" button — lets users refresh the general tip with a fade animation without re-scanning
  • No repeatsgetRandomTip() tracks the last shown index to avoid showing the same tip twice in a row
  • showTips(threatTypes) — called after every scan result, injects the tips card below the result
  • Tips card is cleanly removed and re-rendered on each new scan

style.css

  • .tips-card — base card with left border (red for threats, green for safe)
  • .tips-threat-section / .tips-threat-label — per-threat grouping with label
  • .tips-list / .tips-list li — styled tip items with arrow prefix
  • .tips-footer-note — "report this URL" note with link to Google Safe Browsing Report
  • .tips-general-tip — fade transition on tip refresh
  • .tips-refresh-btn — styled button matching the site's design language

Behavior

  • Threat detected → tips card shows with red left border, threat-specific sections, and a report link
  • URL safe → tips card shows with green left border, one random general tip, and a refresh button
  • Re-scanning always clears the old tips card before showing new one

@Mrinalray

Copy link
Copy Markdown
Owner

@shresthbhargava added screenshot

@shresthbhargava

Copy link
Copy Markdown
Author
image screenshot posted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Safe Browsing Educational Tips

2 participants