feat: Add Domain Information Card - closes #184#185
Open
M0izz wants to merge 1 commit into
Open
Conversation
Closes Mrinalray#184 Add a client-side Domain Information Card that parses the scanned URL and displays a structural breakdown (protocol, hostname, subdomain, domain, TLD, path, query, fragment) alongside the existing scan-result card. The card auto-updates on every scan via a single renderDomainInfoCard() call hoisted after the if/else block in checkSecurity(). Changes - domain-info-card.js (new): URL parsing via native URL API, splitHostname heuristic, three render states (idle / error / success), exposes window.renderDomainInfoCard() for script.js integration - domain-info-card.css (new): dark monospace packet-inspector aesthetic, #35d8c8 cyan for populated values, #a8894f amber for missing (—) placeholders, 420px responsive breakpoint, prefers-reduced-motion guard, light-mode overrides via .light-mode class - index.html: +3 lines (CSS link, #domainInfoCard mount, script tag) - script.js: +2 lines (renderDomainInfoCard(url) after if/else, renderDomainInfoCard('') in catch) Known limitation: splitHostname uses a last-label heuristic and does NOT consult the Public Suffix List. Compound TLDs (.co.uk, .com.au) will split incorrectly. A proper fix via psl/tldts is deferred to a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #184
Summary
Adds a Domain Information Card to the URL scanner page that parses the scanned URL client-side and displays a structural breakdown alongside the existing scan-result card.
Changes
domain-info-card.jsURLAPI + render logicdomain-info-card.cssindex.html#domainInfoCardmount div, script tagscript.jsrenderDomainInfoCard(url)after if/else,renderDomainInfoCard('')in catchAcceptance Criteria
URLAPI - no third-party parser-(em dash), not blank/null/undefinedcheckSecurity().light-modeclass on<html>prefers-reduced-motionguard disables animations for accessibilityVerified Edge Cases
https://mail.google.com/search?q=security#resultshttp://example.comhttps://localhost:3000/testnot a urlKnown Limitation (follow-up)
The
splitHostnamefunction uses a last-label heuristic and does not consult the Public Suffix List. Compound TLDs (.co.uk,.com.au) split incorrectly. A proper fix viapslortldtsis a deliberate follow-up - not a silent workaround.