Skip to content

Title: Add ability to share scan result via shareable link #180

Description

@NaitikVerma6776

Description

Currently after scanning a URL, there is no way to share the result with someone else.
Users who find a suspicious link and want to warn others have to manually copy and
explain the result. A shareable link would make this much easier.

Expected Behaviour

After a scan completes (safe or danger), a "Share Result" button should appear on the
result card. Clicking it should generate a link like:

https://cybershield-url.netlify.app/?url=https://suspicious-site.com

Opening that link should auto-fill the URL input and immediately trigger the scan,
so the recipient sees the result without any extra steps.

Implementation Suggestion

  • Add a "Share" button inside showResult() in script.js
  • On click, construct window.location.origin + '?url=' + encodeURIComponent(scannedUrl)
    and copy it to clipboard using navigator.clipboard.writeText()
  • On page load, check new URLSearchParams(window.location.search).get('url')
    if present, auto-fill the input and call checkSecurity() automatically
  • Show "Link copied!" feedback for ~2 seconds after clicking
  • Button should use existing design tokens (no new dependencies)

Files to change

  • script.js — update showResult() to add Share button, add URL param auto-scan on load
  • style.css — add share button styles matching existing design system

heyy @Mrinalray ,I'd like to work on this issue.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions