Browse with confidence, click with security.
ClickSafe is a Google Chrome extension powered by machine learning that analyzes websites and predicts their safety level in real time. It extracts 50+ URL, host, and webpage-content features and uses a weighted ensemble of ML models to detect suspicious or malicious websites. SHAP explainability shows which features contributed to each prediction.
| Section | |
|---|---|
| 01 | Demo |
| 02 | Key Features |
| 03 | System Architecture |
| 04 | Model Performance |
| 05 | Feature Categories |
| 06 | ML Pipeline |
| 07 | Project Structure |
| 08 | Installation |
| 09 | How It Works |
| 10 | Technologies Used |
| 11 | Dataset |
| 12 | SHAP Explainability |
| 13 | Results |
| 14 | Future Improvements |
| 15 | Disclaimer |
| π’ Safe | π’ Very Low Risk |
|---|---|
![]() |
![]() |
google.com: Safe |
example.com: Very Low Risk |
| π Unsafe | π΄ Danger |
![]() |
![]() |
z-library.sk: Unsafe (58%) |
Phishing URL: Danger |
| Safe Prediction | Unsafe Prediction |
|---|---|
![]() |
![]() |
| Top contributors to a safe result | Top contributors to an unsafe result |
| Feature | Description |
|---|---|
| Dynamic Analysis | Extracts 50+ lexical, URL, host/domain, and webpage-content features |
| ML Ensemble | Combines Random Forest, XGBoost, Gradient Boosting, and Extra Trees |
| Weighted Prediction | Ensemble weighting improves robustness and generalization |
| 5-Level Risk Rating | Granular risk classification from Safe to Danger |
| SHAP Explainability | Feature-level explanations for every prediction |
| Chrome Extension | Popup UI with manual URL entry or one-click current tab analysis |
| Interactive Analytics | Visualizations of prediction factors and feature importance |
| Level | Color | Probability |
|---|---|---|
| Safe | π’ | < 20% |
| Very Low Risk | π’ | 20β30% |
| Moderate Risk | π‘ | 30β50% |
| Unsafe | π | 50β80% |
| Danger | π΄ | β₯ 80% |
Chrome Browser + ClickSafe Extension
β
βΌ
URL Processing
β
βΌ
Feature Extraction
βββββββββββββββββββββ
β β’ URL / Lexical β
β β’ Host / Domain β
β β’ Webpage Content β
β β’ 50+ Features β
ββββββββββ¬βββββββββββ
β
βΌ
ML Model Ensemble
βββββββββββββββββββββ
β β’ Random Forest β
β β’ XGBoost β
β β’ Gradient Boost β
β β’ Extra Trees β
ββββββββββ¬βββββββββββ
β
βΌ
Weighted Prediction
ββββ΄βββ
βΌ βΌ
Risk Level SHAP Explanation
ββββ¬βββ
βΌ
ClickSafe Extension UI
| Metric | Score |
|---|---|
| Accuracy | 91.36% |
| Precision | 92.4% |
| Recall | 89.2% |
| F1-Score | 90.7% |
| ROC-AUC | 0.9744 |
Among individual models, XGBoost achieved the highest accuracy at 91.72%.
- URL length, depth, and structure
- Number of dots, subdomains, and parameters
- Digit ratio and suspicious character patterns
- HTTPS usage and URL shortening
- Suspicious prefixes/suffixes and uncommon TLDs
- Double-slash patterns
- Domain age and registration length
- IP address usage and numeric domain detection
- Number of hyphens and hostname length
- Domain misspelling and brand matching
- Non-standard ports and TLD-related signals
- Number and ratio of hyperlinks (internal vs external)
- External redirection ratio
- Links inside
<script>,<meta>, and other HTML tags - Domain presence in page title
- Internal/external media ratios
- External CSS count and phishing keyword hints
Dataset β Data Cleaning β Feature Engineering β Missing Value Handling
β Feature Selection β Train/Test Split (80/20)
β Model Training (RF, XGBoost, GB, Extra Trees)
β Weighted Ensemble β Risk Prediction β SHAP Explanation
ClickSafe-DynamicWebSafety/
β
βββ app.py # Flask backend
βββ feature_extract.py # Feature extraction logic
βββ requirements.txt
β
βββ manifest.json # Chrome extension manifest
βββ popup.html / popup.css / popup.js
βββ background.js
βββ analytics.html / analytics.js
β
βββ *.pkl # Trained model files
βββ Images/ # Demo screenshots
βββ README.md
Note: Some
.pklmodel files exceed GitHub's size limit and are hosted separately on Google Drive. See Download Trained Models in the Installation section.
git clone https://github.com/sprahasingh/ClickSafe-DynamicWebSafety.git
cd ClickSafe-DynamicWebSafetypip install -r requirements.txtDownload the .pkl files from Google Drive and place them in the project root.
python app.py- Open Chrome and go to
chrome://extensions/ - Enable Developer mode
- Click Load unpacked
- Select the
ClickSafe-DynamicWebSafetydirectory - Ensure the Flask backend is running, then open any website
- Open the ClickSafe extension in Chrome. Two ways to analyze a website:
- Enter a URL manually: type or paste any URL into the input field and click Check Website
- Check the current tab: the extension auto-fills the active tab's URL for instant analysis
- The URL is sent to the Flask backend for processing
- 50+ features are extracted across URL, host, and content categories
- Four ML models each generate an independent risk prediction
- The weighted ensemble combines the predictions into a final risk score
- A risk level (Safe β Danger) is assigned based on the score
- SHAP identifies the top features that contributed to the prediction
- The extension displays the risk level, verdict, and feature-level explanation
| Technology | Purpose |
|---|---|
| Python | Backend and ML pipeline |
| Flask | REST API backend |
| scikit-learn | ML models (RF, GB, Extra Trees) |
| XGBoost | Gradient boosting classifier |
| SHAP | Model explainability |
| HTML / CSS / JavaScript | Chrome extension UI |
| Chrome APIs | Browser integration |
| Joblib / Pickle | Model serialization |
- Sources: Kaggle, PhishTank, Government websites, Custom crawling
- Size: 100,000+ instances, 50+ features
- Balance: Safe 51.74% / Unsafe 48.26%
- Split: 80% train / 20% test (with validation during tuning)
ClickSafe uses SHAP (SHapley Additive exPlanations) so users understand why a prediction was made, not just what the verdict is.
For an unsafe prediction, top contributing features might include:
- High slash count in the URL
- Suspicious URL depth
- IP address used instead of a domain name
For a safe prediction, top contributing features might include:
- Established domain age
- Long registration period
- High ratio of internal links
- 91.36% overall accuracy
- 92.4% precision / 89.2% recall / 90.7% F1-score
- 0.9744 ROC-AUC
- 50+ engineered features across 3 categories
- 4 ML classifiers in a weighted ensemble
- 5 user-facing risk levels
- Full SHAP-based prediction explanations
- Deep learning models for webpage-content analysis
- Real-time threat-intelligence feed integration
- Behavioral and JavaScript-based website analysis
- Multimodal detection (text + images + URL)
- Cloud deployment with scalable APIs
- Continuous learning from user feedback
- Cross-browser and mobile browser support
ClickSafe is an academic machine-learning project for website-risk assessment. Predictions should not be treated as a guarantee that a website is safe or malicious.
Spraha Singh Β· GitHub





