- Overview
- Features
- Installation
- Usage
- Technical Architecture
- Scoring System
- Security Checks
- UI/UX
- Testing
- Project Structure
- Permissions
- Future Enhancements
- Contributing
- License
WebAudit is a lightweight Chrome/Edge extension that performs real-time structural, security, and developer analysis of any webpage, presenting clear scores with actionable insights. It's designed to help:
- Beginner web developers learn best practices
- Cybersecurity students understand common vulnerabilities
- Bug bounty hunters quickly assess target pages
- QA engineers perform quick audits
- Webmasters check site health
In today's web development landscape, security, accessibility, and performance are often overlooked. WebAudit provides instant feedback on:
- HTML structure quality
- Security vulnerabilities (CSP, SRI, XSS, cookies)
- Accessibility best practices (ARIA, labels)
- Performance patterns (lazy loading, render blocking)
| Feature | Description |
|---|---|
| Form Counter | Counts all <form> elements on the page |
| Input Field Counter | Counts all <input> elements |
| Script Counter | Counts total script tags (inline + external) |
| External CSS Counter | Counts external stylesheet links |
| Image Alt Checker | Detects images missing alt attributes |
| Meta Description | Checks for presence of meta description |
| Viewport Tag | Checks for responsive design viewport tag |
| Deprecated Tags | Detects obsolete HTML tags (center, font, etc.) |
| Check | Risk Level | Description |
|---|---|---|
| HTTPS Detection | π΄ High | Verifies page uses secure protocol |
| CSP Detection | π΄ High | Checks for Content-Security-Policy |
| SRI Check | π‘ Medium | Verifies Subresource Integrity on scripts |
| DOM XSS Sinks | π΄ High | Detects eval(), document.write, innerHTML |
| Cookie Security | π‘ Medium | Checks for Secure, HttpOnly, SameSite |
| X-Frame-Options | π‘ Medium | Clickjacking protection check |
| Referrer Policy | π’ Low | Controls information leakage |
| Inline Script Detection | π‘ Medium | Finds inline <script> tags (XSS risk) |
| Form CSRF Protection | π΄ High | Checks for CSRF tokens in forms |
| Mixed Content | π΄ High | Detects HTTP resources on HTTPS pages |
| Check | Description |
|---|---|
| Resource Counting | Images, CSS, JS, fonts, video, audio |
| Render Blocking | Detects blocking CSS/JS in head |
| Lazy Loading | Checks for loading="lazy" on images |
| Accessibility | ARIA labels, input labels, semantic roles |
| Deprecated Tags | Detects obsolete HTML elements |
The extension calculates four scores:
- Structure Score (0-100) - Based on HTML best practices
- Security Score (0-100) - Based on security vulnerabilities
- Developer Score (0-100) - Based on best practices
- Weighted Overall (0-100) - Security-weighted average (50% security, 25% structure, 25% developer)
| Score Range | Category | Color | Action Required |
|---|---|---|---|
| 80-100 | π’ Safe | Green | None |
| 50-79 | π‘ Moderate | Yellow | Review issues |
| 0-49 | π΄ High Risk | Red | Urgent attention |
- Dark Mode (default) π
- Light Mode βοΈ
- Theme Toggle - Persists preference in localStorage
- Circular Score Gauge - Visual representation
- Issue List - Color-coded by severity
- Minimalist Design - GitHub-inspired color scheme
- Google Chrome browser (version 88 or higher)
- OR any Chromium-based browser (Edge, Brave, etc.)
-
Download or Clone the Repository
git clone https://github.com/yourusername/webaudit.git cd webaudit -
Open Chrome Extensions
- Navigate to
chrome://extensionsin Chrome address bar - OR click Menu β More Tools β Extensions
- Navigate to
-
Enable Developer Mode
- Toggle the switch in the top-right corner: "Developer mode"
-
Load the Extension
- Click the "Load unpacked" button
- Select the
WebAuditfolder from your files
-
Pin to Browser
- Click the puzzle piece icon (π§©) in Chrome toolbar
- Click the pin icon next to WebAudit
- The WebAudit icon π should appear in your toolbar
- Click it to see the popup interface
- Navigate to any webpage you want to analyze
- Click the WebAudit extension icon in your browser toolbar
- The extension automatically scans the page
- View the results:
- Overall health score (weighted)
- Structure, Security, and Developer breakdowns
- List of detected issues
- Shows overall health score (0-100)
- Color indicates risk level
- Structure: HTML quality score
- Security: Security vulnerability score (weighted 50%)
- Developer: Best practices score
- Each issue shows:
- Icon indicating type (security vs structure)
- Description of the issue
- Color-coded border (red=security, yellow=structure)
- Click the π/βοΈ button in the header
- Theme preference is saved automatically
- Persists across browser sessions
The extension uses Chrome's Manifest V3, the latest standard for Chrome extensions.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β manifest.json β
β (Extension Configuration) β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β background β β content β β popup β
β .js β β .js β β .html/js β
β (Service β β (Injected β β (UI & β
β Worker) β β Script) β β Logic) β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
| File | Purpose |
|---|---|
manifest.json |
Extension configuration, permissions, metadata |
background.js |
Service worker, handles message passing |
content.js |
Injected script, performs DOM analysis |
popup.html |
Extension popup UI with embedded CSS |
popup.js |
Popup logic, theme management, result display |
ββββββββββββ sendMessage ββββββββββββββ
β Popup β βββββββββββββββββββΆ β Background β
β β β Worker β
ββββββββββββ ββββββββ¬ββββββ
β tabs.sendMessage
βΌ
ββββββββββββββ
β Content β
β Script β
βββββββββββββ
- User clicks extension icon β Popup opens
- Popup sends message to background worker
- Background worker sends message to content script
- Content script analyzes DOM
- Results flow back to popup
- Popup displays analysis
Base Score: 100
Deductions:
βββ Images without alt (each): -5
βββ Inline scripts (each): -3
βββ Missing meta description: -10
βββ Missing viewport tag: -5
Final Score = max(0, min(100, Base - Deductions))
Base Score: 100
Deductions:
βββ No HTTPS: -30
βββ JWT in localStorage: -25
βββ API keys found: -20
βββ Excessive scripts (>10): -15
βββ Inline scripts (each): -2
βββ Exposed tokens: -15
Final Score = max(0, min(100, Base - Deductions))
Overall = round((Structure Score + Security Score) / 2)
- What: Checks if page uses
https://protocol - Why: HTTPS provides encryption and authentication
- Risk: Without HTTPS, data can be intercepted
- What: Finds
<script>tags withoutsrcattribute - Why: Inline scripts are XSS attack vectors
- Recommendation: Use external files
- What: Searches localStorage for JWT patterns
- Why: localStorage is vulnerable to XSS attacks
- Recommendation: Use httpOnly cookies
- What: Regex search for common key patterns
- Patterns detected:
api_key,apikey,api-keysecret,passwordtoken,bearer
- Risk: Exposed credentials can be stolen
- What: Counts external script tags
- Threshold: >10 scripts flagged
- Risk: Supply chain attacks, performance issues
- What: Searches HTML attributes for long strings
- Why: Tokens in HTML can be scraped
- Risk: Unauthorized access
| Element | Color | Hex |
|---|---|---|
| Background | Dark | #0d1117 |
| Secondary | Dark Gray | #161b22 |
| Tertiary | Gray | #21262d |
| Text | White | #f0f6fc |
| Text Secondary | Gray | #8b949e |
| Accent Blue | Blue | #58a6ff |
| Safe | Green | #3fb950 |
| Warning | Yellow | #d29922 |
| Danger | Red | #f85149 |
| Border | Gray | #30363d |
| Element | Color | Hex |
|---|---|---|
| Background | White | #ffffff |
| Secondary | Light Gray | #f6f8fa |
| Tertiary | Gray | #eaeef2 |
| Text | Dark | #1f2328 |
| Text Secondary | Gray | #656d76 |
| Accent Blue | Blue | #0969da |
| Safe | Green | #1a7f37 |
| Warning | Yellow | #9a6700 |
| Danger | Red | #cf222e |
-
Header
- Logo and title
- Theme toggle button
- URL display
- HTTPS status badge
-
Score Section
- Circular score gauge
- Risk label badge
- Structure/Security breakdown cards
-
Issues List
- Scrollable list
- Color-coded by type
- Icon + description format
-
Footer
- Version info
- Credit text
| File | Purpose | Expected Score |
|---|---|---|
test-page.html |
Moderate issues | ~63 (Moderate) |
test-page-high-risk.html |
Multiple security issues | ~44 (High Risk) |
- Load extension in Chrome
- Open test page in browser
- Click WebAudit icon
- Verify scores match expected values
- Extension loads without errors
- Analysis completes in <1 second
- Dark mode displays correctly
- Light mode displays correctly
- Theme toggle works
- Scores calculate correctly
- Issues are detected accurately
WebAudit/
βββ manifest.json # MV3 configuration
βββ background.js # Service worker
βββ content.js # DOM analyzer
βββ popup.html # Popup UI
βββ popup.js # Popup logic
βββ README.md # Documentation
βββ TODO.md # Project tracking
βββ test-page.html # Test page (moderate)
βββ test-page-high-risk.html # Test page (high risk)
| Permission | Purpose |
|---|---|
activeTab |
Access current tab's information |
scripting |
Execute content scripts |
| Permission | Purpose |
|---|---|
<all_urls> |
Analyze any webpage |
- No data collected: Extension runs entirely locally
- No external calls: All analysis done client-side
- No backend: Works offline after installation
- Console Error Counter - Count JavaScript errors
- CSP Header Detection - Check Content-Security-Policy
- JSON Report Export - Download analysis as JSON
- Backend Integration - Future ML-powered analysis
- Side Panel View - Alternative to popup UI
- Cookie Security Check - Analyze cookie attributes
- CORS Detection - Check CORS policy
- Mixed Content Scanner - Find HTTP resources on HTTPS pages
- Integration with FastAPI backend
- Anomaly detection using Isolation Forest
- Community-shared security rules
- Chrome Web Store publication
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
# Clone the repo
git clone https://github.com/yourusername/webaudit.git
# Make changes
# Edit files in your favorite editor
# Test locally
# 1. Go to chrome://extensions
# 2. Click "Reload" on WebAudit
# 3. Test your changes- Use clear, descriptive variable names
- Comment complex logic
- Follow JavaScript best practices
- Keep functions focused and small
This project is licensed under the MIT License.
See LICENSE for details.
- OWASP - Security guidelines and principles
- Chrome Extensions Documentation - Manifest V3 reference
- GitHub - Design inspiration for dark mode
Made with β€οΈ for developers and cybersecurity enthusiasts
π WebAudit v2.0.0